tensorflow / serving
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
pb
patch
meta
  • 15 extensions are included in analyses: cc, h, proto, md, py, txt, sh, pb, bzl, json, patch, yaml, svg, meta, gitignore
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (2 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (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 ".*/testdata/.*" (Test data) (32 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (0 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.

main22267 LOC (40%) 266 files
test23326 LOC (42%) 132 files
generated0 LOC (0%) 0 files
build and deployment116 LOC (<1%) 3 files
other9015 LOC (16%) 31 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 ".*".
  • 266 files match defined criteria (22,267 lines of code, 100.0% vs. main code):
    • 91 *.cc files (13,341 lines of code)
    • 120 *.h files (6,607 lines of code)
    • 30 *.proto files (1,030 lines of code)
    • 18 *.py files (1,018 lines of code)
    • 5 *.bzl files (215 lines of code)
    • 2 *.yaml files (56 lines of code)
  • " *.cc" is biggest, containing 59.91% of code.
  • " *.yaml" is smallest, containing 0.25% of code.


*.cc13341 LOC (59%) 91 files
*.h6607 LOC (29%) 120 files
*.proto1030 LOC (4%) 30 files
*.py1018 LOC (4%) 18 files
*.bzl215 LOC (<1%) 5 files
*.yaml56 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
proto
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 ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 132 files match defined criteria (23,326 lines of code, 104.8% vs. main code):
    • 91 *.cc files (21,277 lines of code)
    • 25 *.h files (1,010 lines of code)
    • 3 *.py files (794 lines of code)
    • 9 *.sh files (203 lines of code)
    • 4 *.proto files (42 lines of code)
  • " *.cc" is biggest, containing 91.22% of code.
  • " *.proto" is smallest, containing 0.18% of code.


*.cc21277 LOC (91%) 91 files
*.h1010 LOC (4%) 25 files
*.py794 LOC (3%) 3 files
*.sh203 LOC (<1%) 9 files
*.proto42 LOC (<1%) 4 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".
  • 3 files match defined criteria (116 lines of code, 0.5% vs. main code). All matches are in *.sh files.


*.sh116 LOC (100%) 3 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]svg".
  • 31 files match defined criteria (9,015 lines of code, 40.5% vs. main code):
    • 2 *.svg files (5,348 lines of code)
    • 29 *.md files (3,667 lines of code)
  • " *.svg" is biggest, containing 59.32% of code.
  • " *.md" is smallest, containing 40.68% of code.


*.svg5348 LOC (59%) 2 files
*.md3667 LOC (40%) 29 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-02-03 07:56