tensorflow / tflite-support
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
proto
txt
patch
tpl
lds
py3
in
diff
  • 22 extensions are included in analyses: h, cc, java, py, json, proto, m, txt, bzl, xml, md, sh, swift, mm, patch, tpl, lds, py3, bat, ipynb, in, diff
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (18 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (70 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 ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (7 files).
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.

main36399 LOC (73%) 475 files
test9175 LOC (18%) 76 files
generated0 LOC (0%) 0 files
build and deployment433 LOC (<1%) 9 files
other3248 LOC (6%) 53 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
py3
lds
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 475 files match defined criteria (36,399 lines of code, 100.0% vs. main code):
    • 105 *.cc files (14,896 lines of code)
    • 119 *.java files (11,391 lines of code)
    • 153 *.h files (5,375 lines of code)
    • 39 *.py files (2,189 lines of code)
    • 26 *.proto files (1,193 lines of code)
    • 18 *.m files (917 lines of code)
    • 7 *.bzl files (281 lines of code)
    • 4 *.mm files (91 lines of code)
    • 1 *.py3 files (39 lines of code)
    • 2 *.lds files (18 lines of code)
    • 1 *.in files (9 lines of code)
  • " *.cc" is biggest, containing 40.92% of code.
  • " *.in" is smallest, containing 0.02% of code.


*.cc14896 LOC (40%) 105 files
*.java11391 LOC (31%) 119 files
*.h5375 LOC (14%) 153 files
*.py2189 LOC (6%) 39 files
*.proto1193 LOC (3%) 26 files
*.m917 LOC (2%) 18 files
*.bzl281 LOC (<1%) 7 files
*.mm91 LOC (<1%) 4 files
*.py339 LOC (<1%) 1 files
*.lds18 LOC (<1%) 2 files
*.in9 LOC (<1%) 1 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 ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 76 files match defined criteria (9,175 lines of code, 25.2% vs. main code):
    • 26 *.cc files (5,092 lines of code)
    • 20 *.py files (2,483 lines of code)
    • 7 *.m files (460 lines of code)
    • 7 *.java files (430 lines of code)
    • 7 *.swift files (337 lines of code)
    • 3 *.bzl files (140 lines of code)
    • 4 *.h files (106 lines of code)
    • 1 *.sh files (66 lines of code)
    • 1 *.mm files (61 lines of code)
  • " *.cc" is biggest, containing 55.5% of code.
  • " *.mm" is smallest, containing 0.66% of code.


*.cc5092 LOC (55%) 26 files
*.py2483 LOC (27%) 20 files
*.m460 LOC (5%) 7 files
*.java430 LOC (4%) 7 files
*.swift337 LOC (3%) 7 files
*.bzl140 LOC (1%) 3 files
*.h106 LOC (1%) 4 files
*.sh66 LOC (<1%) 1 files
*.mm61 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 ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/AndroidManifest[.]xml".
  • 9 files match defined criteria (433 lines of code, 1.2% vs. main code):
    • 8 *.sh files (407 lines of code)
    • 1 *.bat files (26 lines of code)
  • " *.sh" is biggest, containing 94% of code.
  • " *.bat" is smallest, containing 6% of code.


*.sh407 LOC (93%) 8 files
*.bat26 LOC (6%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]diff".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 53 files match defined criteria (3,248 lines of code, 8.9% vs. main code):
    • 14 *.md files (1,263 lines of code)
    • 12 *.cc files (1,192 lines of code)
    • 8 *.py files (374 lines of code)
    • 1 *.ipynb files (278 lines of code)
    • 15 *.xml files (86 lines of code)
    • 3 *.h files (55 lines of code)
  • " *.md" is biggest, containing 38.89% of code.
  • " *.h" is smallest, containing 1.69% of code.


*.md1263 LOC (38%) 14 files
*.cc1192 LOC (36%) 12 files
*.py374 LOC (11%) 8 files
*.ipynb278 LOC (8%) 1 files
*.xml86 LOC (2%) 15 files
*.h55 LOC (1%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.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
  • *.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
  • *.proto 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
  • *.m 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
  • *.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
  • *.mm 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
  • *.py3 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
  • *.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
  • *.in files are analyzed with RustAnalyzer:
    • 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


2022-02-03 08:24