pytorch / serve
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
txt
properties
cfg
in
proto
pt
toml
tpl
  • 25 extensions are included in analyses: py, java, md, txt, json, yaml, sh, properties, gradle, xml, yml, cfg, js, rst, gitignore, ipynb, bat, in, css, proto, pt, html, toml, Dockerfile, tpl
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (2 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (22 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (33 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) (64 files).
    • exclude files with path like ".*/static/js/.*" (JS library) (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.

main20102 LOC (39%) 319 files
test9344 LOC (18%) 114 files
generated0 LOC (0%) 0 files
build and deployment1199 LOC (2%) 30 files
other20458 LOC (40%) 199 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
tpl
toml
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 319 files match defined criteria (20,102 lines of code, 100.0% vs. main code):
    • 158 *.java files (11,751 lines of code)
    • 109 *.py files (6,268 lines of code)
    • 34 *.yaml files (1,781 lines of code)
    • 10 *.yml files (111 lines of code)
    • 2 *.proto files (108 lines of code)
    • 1 *.tpl files (48 lines of code)
    • 1 *.toml files (18 lines of code)
    • 1 *.dockerfile files (9 lines of code)
    • 3 *.in files (8 lines of code)
  • " *.java" is biggest, containing 58.46% of code.
  • " *.in" is smallest, containing 0.04% of code.


*.java11751 LOC (58%) 158 files
*.py6268 LOC (31%) 109 files
*.yaml1781 LOC (8%) 34 files
*.yml111 LOC (<1%) 10 files
*.proto108 LOC (<1%) 2 files
*.tpl48 LOC (<1%) 1 files
*.toml18 LOC (<1%) 1 files
*.dockerfile9 LOC (<1%) 1 files
*.in8 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cfg
pt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*_test[.].*".
  • 114 files match defined criteria (9,344 lines of code, 46.5% vs. main code):
    • 68 *.py files (4,433 lines of code)
    • 16 *.java files (4,373 lines of code)
    • 16 *.yaml files (337 lines of code)
    • 6 *.cfg files (108 lines of code)
    • 2 *.sh files (63 lines of code)
    • 2 *.yml files (26 lines of code)
    • 4 *.pt files (4 lines of code)
  • " *.py" is biggest, containing 47.44% of code.
  • " *.pt" is smallest, containing 0.04% of code.


*.py4433 LOC (47%) 68 files
*.java4373 LOC (46%) 16 files
*.yaml337 LOC (3%) 16 files
*.cfg108 LOC (1%) 6 files
*.sh63 LOC (<1%) 2 files
*.yml26 LOC (<1%) 2 files
*.pt4 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 ".*[.]gradle".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/pom[.]xml".
  • 30 files match defined criteria (1,199 lines of code, 6.0% vs. main code):
    • 16 *.gradle files (626 lines of code)
    • 12 *.sh files (434 lines of code)
    • 2 *.bat files (139 lines of code)
  • " *.gradle" is biggest, containing 52.21% of code.
  • " *.bat" is smallest, containing 11.59% of code.


*.gradle626 LOC (52%) 16 files
*.sh434 LOC (36%) 12 files
*.bat139 LOC (11%) 2 files
Other Code
properties
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 ".*[.]properties".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 199 files match defined criteria (20,458 lines of code, 101.8% vs. main code):
    • 53 *.json files (10,718 lines of code)
    • 56 *.md files (5,333 lines of code)
    • 42 *.py files (1,589 lines of code)
    • 2 *.ipynb files (1,214 lines of code)
    • 14 *.xml files (1,089 lines of code)
    • 23 *.properties files (305 lines of code)
    • 3 *.sh files (106 lines of code)
    • 3 *.rst files (60 lines of code)
    • 3 *.yaml files (44 lines of code)
  • " *.json" is biggest, containing 52.39% of code.
  • " *.yaml" is smallest, containing 0.22% of code.


*.json10718 LOC (52%) 53 files
*.md5333 LOC (26%) 56 files
*.py1589 LOC (7%) 42 files
*.ipynb1214 LOC (5%) 2 files
*.xml1089 LOC (5%) 14 files
*.properties305 LOC (1%) 23 files
*.sh106 LOC (<1%) 3 files
*.rst60 LOC (<1%) 3 files
*.yaml44 LOC (<1%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.yml 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
  • *.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
  • *.tpl 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
  • *.toml 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
  • *.dockerfile 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-01-24 14:34