tensorflow / tflite-micro
Source Code Overview

Analysis scope, overview of main, test, generated, deployment, build, and other code.

Source Code Analysis Scope
Files includes and excluded from analyses
patch
txt
ld
mako
lds
clang-format
  • 18 extensions are included in analyses: cc, h, sh, md, inc, py, c, yml, patch, bzl, txt, ipynb, ld, json, gitignore, mako, lds, clang-format
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (21 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (19 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (14 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (2 files).
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (1 file).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (0 files).
    • exclude files with path like ".*[.]txt" (Text files) (6 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
Overview of Analyzed Files
Basic stats on analyzed files
Intro
For analysis purposes we separate files in scope into several categories: main, test, generated, deployment and build, and other.

  • The main category contains all manually created source code files that are being used in the production.
  • Files in the main category are used as input for other analyses: logical decomposition, concerns, duplication, file size, unit size, and conditional complexity.
  • Test source code files are used only for testing of the product. These files are normally not deployed to production.
  • Build and deployment source code files are used to configure or support build and deployment process.
  • Generated source code files are automatically generated files that have not been manually changed after generation.
  • While a source code folder may contain a number of files, we are primarily interested in the source code files that are being written and maintained by developers.
  • Files containing binaries, documentation, or third-party libraries, for instance, are excluded from analysis. The exception are third-party libraries that have been changed by developers.

main65971 LOC (62%) 462 files
test27466 LOC (26%) 143 files
generated0 LOC (0%) 0 files
build and deployment738 LOC (<1%) 23 files
other10592 LOC (10%) 164 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ld
mako
lds
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 462 files match defined criteria (65,971 lines of code, 100.0% vs. main code):
    • 185 *.h files (32,665 lines of code)
    • 191 *.cc files (27,775 lines of code)
    • 34 *.inc files (1,557 lines of code)
    • 16 *.py files (1,358 lines of code)
    • 23 *.c files (1,188 lines of code)
    • 5 *.ld files (957 lines of code)
    • 2 *.mako files (168 lines of code)
    • 2 *.lds files (160 lines of code)
    • 4 *.bzl files (143 lines of code)
  • " *.h" is biggest, containing 49.51% of code.
  • " *.bzl" is smallest, containing 0.22% of code.


*.h32665 LOC (49%) 185 files
*.cc27775 LOC (42%) 191 files
*.inc1557 LOC (2%) 34 files
*.py1358 LOC (2%) 16 files
*.c1188 LOC (1%) 23 files
*.ld957 LOC (1%) 5 files
*.mako168 LOC (<1%) 2 files
*.lds160 LOC (<1%) 2 files
*.bzl143 LOC (<1%) 4 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 143 files match defined criteria (27,466 lines of code, 41.6% vs. main code):
    • 109 *.cc files (25,696 lines of code)
    • 4 *.py files (677 lines of code)
    • 24 *.sh files (665 lines of code)
    • 5 *.h files (427 lines of code)
    • 1 *.inc files (1 lines of code)
  • " *.cc" is biggest, containing 93.56% of code.
  • " *.inc" is smallest, containing 0% of code.


*.cc25696 LOC (93%) 109 files
*.py677 LOC (2%) 4 files
*.sh665 LOC (2%) 24 files
*.h427 LOC (1%) 5 files
*.inc1 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 23 files match defined criteria (738 lines of code, 1.1% vs. main code). All matches are in *.sh files.


*.sh738 LOC (100%) 23 files
Other Code
patch
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 164 files match defined criteria (10,592 lines of code, 16.1% vs. main code):
    • 59 *.cc files (4,368 lines of code)
    • 28 *.md files (2,301 lines of code)
    • 16 *.py files (1,212 lines of code)
    • 4 *.ipynb files (839 lines of code)
    • 9 *.patch files (750 lines of code)
    • 36 *.h files (637 lines of code)
    • 6 *.inc files (427 lines of code)
    • 4 *.sh files (48 lines of code)
    • 2 *.json files (10 lines of code)
  • " *.cc" is biggest, containing 41.24% of code.
  • " *.json" is smallest, containing 0.09% of code.


*.cc4368 LOC (41%) 59 files
*.md2301 LOC (21%) 28 files
*.py1212 LOC (11%) 16 files
*.ipynb839 LOC (7%) 4 files
*.patch750 LOC (7%) 9 files
*.h637 LOC (6%) 36 files
*.inc427 LOC (4%) 6 files
*.sh48 LOC (<1%) 4 files
*.json10 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.h files are analyzed with CppAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis
  • *.cc files are analyzed with CppAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis
  • *.inc files are analyzed with PhpAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Basic heuristic dependency analysis
  • *.py files are analyzed with PythonAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Basic heuristic dependency analysis
  • *.c files are analyzed with CStyleAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.ld files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.mako files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.lds files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.bzl files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis


2022-02-03 08:25