pytorch / test-infra
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
ps1
ini
diff
hcl
gitattributes
  • 18 extensions are included in analyses: ts, json, py, yml, tsx, md, css, txt, ps1, gitignore, js, ini, diff, hcl, tf, sh, gitattributes, html
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (23 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • 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) (8 files).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (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.

main7159 LOC (34%) 98 files
test1195 LOC (5%) 11 files
generated0 LOC (0%) 0 files
build and deployment184 LOC (<1%) 4 files
other12410 LOC (59%) 39 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ps1
hcl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 98 files match defined criteria (7,159 lines of code, 100.0% vs. main code):
    • 22 *.py files (2,885 lines of code)
    • 26 *.ts files (1,795 lines of code)
    • 20 *.tsx files (1,548 lines of code)
    • 9 *.css files (273 lines of code)
    • 6 *.ps1 files (216 lines of code)
    • 2 *.tf files (158 lines of code)
    • 7 *.yml files (142 lines of code)
    • 2 *.hcl files (92 lines of code)
    • 3 *.js files (31 lines of code)
    • 1 *.html files (19 lines of code)
  • " *.py" is biggest, containing 40.3% of code.
  • " *.html" is smallest, containing 0.27% of code.


*.py2885 LOC (40%) 22 files
*.ts1795 LOC (25%) 26 files
*.tsx1548 LOC (21%) 20 files
*.css273 LOC (3%) 9 files
*.ps1216 LOC (3%) 6 files
*.tf158 LOC (2%) 2 files
*.yml142 LOC (1%) 7 files
*.hcl92 LOC (1%) 2 files
*.js31 LOC (<1%) 3 files
*.html19 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 ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/test_.*".
  • 11 files match defined criteria (1,195 lines of code, 16.7% vs. main code):
    • 10 *.ts files (1,162 lines of code)
    • 1 *.py files (33 lines of code)
  • " *.ts" is biggest, containing 97.24% of code.
  • " *.py" is smallest, containing 2.76% of code.


*.ts1162 LOC (97%) 10 files
*.py33 LOC (2%) 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 ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/docker[-]compose[.]yml".
  • 4 files match defined criteria (184 lines of code, 2.6% vs. main code):
    • 2 *.sh files (116 lines of code)
    • 2 *.yml files (68 lines of code)
  • " *.sh" is biggest, containing 63.04% of code.
  • " *.yml" is smallest, containing 36.96% of code.


*.sh116 LOC (63%) 2 files
*.yml68 LOC (36%) 2 files
Other Code
diff
ini
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 ".*/[.]gitignore".
    • files with paths like ".*[.]diff".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]ini".
  • 39 files match defined criteria (12,410 lines of code, 173.3% vs. main code):
    • 23 *.json files (8,755 lines of code)
    • 2 *.diff files (3,255 lines of code)
    • 12 *.md files (339 lines of code)
    • 2 *.ini files (61 lines of code)
  • " *.json" is biggest, containing 70.55% of code.
  • " *.ini" is smallest, containing 0.49% of code.


*.json8755 LOC (70%) 23 files
*.diff3255 LOC (26%) 2 files
*.md339 LOC (2%) 12 files
*.ini61 LOC (<1%) 2 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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.tsx files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.ps1 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
  • *.tf 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
  • *.hcl 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
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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


2022-01-24 14:35