tensorflow / models
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
tpl
mat
meta
  • 18 extensions are included in analyses: py, md, yaml, proto, sh, cc, txt, ipynb, h, json, bzl, yml, tpl, html, gitignore, xml, mat, meta
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (6 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (13 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (16 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 ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (8 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (18 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.

main218106 LOC (63%) 1662 files
test98445 LOC (28%) 583 files
generated0 LOC (0%) 0 files
build and deployment1362 LOC (<1%) 30 files
other23778 LOC (6%) 177 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1662 files match defined criteria (218,106 lines of code, 100.0% vs. main code):
    • 1,441 *.py files (201,587 lines of code)
    • 132 *.yaml files (7,828 lines of code)
    • 22 *.cc files (4,079 lines of code)
    • 47 *.proto files (3,606 lines of code)
    • 17 *.h files (581 lines of code)
    • 3 *.bzl files (425 lines of code)
  • " *.py" is biggest, containing 92.43% of code.
  • " *.bzl" is smallest, containing 0.19% of code.


*.py201587 LOC (92%) 1441 files
*.yaml7828 LOC (3%) 132 files
*.cc4079 LOC (1%) 22 files
*.proto3606 LOC (1%) 47 files
*.h581 LOC (<1%) 17 files
*.bzl425 LOC (<1%) 3 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 any line of content like ".*/simpletest/.*".
  • 583 files match defined criteria (98,445 lines of code, 45.1% vs. main code):
    • 575 *.py files (96,408 lines of code)
    • 6 *.cc files (1,917 lines of code)
    • 1 *.sh files (90 lines of code)
    • 1 *.yaml files (30 lines of code)
  • " *.py" is biggest, containing 97.93% of code.
  • " *.yaml" is smallest, containing 0.03% of code.


*.py96408 LOC (97%) 575 files
*.cc1917 LOC (1%) 6 files
*.sh90 LOC (<1%) 1 files
*.yaml30 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 30 files match defined criteria (1,362 lines of code, 0.6% vs. main code). All matches are in *.sh files.


*.sh1362 LOC (100%) 30 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • 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 ".*/[.]gitignore".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 177 files match defined criteria (23,778 lines of code, 10.9% vs. main code):
    • 134 *.md files (12,878 lines of code)
    • 17 *.ipynb files (9,671 lines of code)
    • 13 *.py files (676 lines of code)
    • 7 *.yaml files (330 lines of code)
    • 1 *.cc files (116 lines of code)
    • 1 *.xml files (80 lines of code)
    • 2 *.sh files (18 lines of code)
    • 1 *.yml files (8 lines of code)
    • 1 *.json files (1 lines of code)
  • " *.md" is biggest, containing 54.16% of code.
  • " *.json" is smallest, containing 0% of code.


*.md12878 LOC (54%) 134 files
*.ipynb9671 LOC (40%) 17 files
*.py676 LOC (2%) 13 files
*.yaml330 LOC (1%) 7 files
*.cc116 LOC (<1%) 1 files
*.xml80 LOC (<1%) 1 files
*.sh18 LOC (<1%) 2 files
*.yml8 LOC (<1%) 1 files
*.json1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.yaml files are analyzed with YamlAnalyzer:
    • 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)
    • No unit size analysis
    • No conditional complexity analysis
    • No 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
  • *.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
  • *.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
  • *.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 07:59