pytorch / benchmark
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
cfg
patch
pt
gitmodules
gitattributes
dockerignore
  • 16 extensions are included in analyses: py, yaml, sh, txt, md, cfg, yml, gitignore, json, patch, ipynb, pt, m, gitmodules, gitattributes, dockerignore
  • 2 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (5 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (43 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.

main55432 LOC (90%) 582 files
test1183 LOC (1%) 19 files
generated0 LOC (0%) 0 files
build and deployment620 LOC (1%) 46 files
other4128 LOC (6%) 88 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cfg
pt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 582 files match defined criteria (55,432 lines of code, 100.0% vs. main code):
    • 483 *.py files (39,792 lines of code)
    • 21 *.cfg files (11,848 lines of code)
    • 67 *.yaml files (2,054 lines of code)
    • 4 *.ipynb files (1,602 lines of code)
    • 4 *.yml files (78 lines of code)
    • 1 *.m files (52 lines of code)
    • 2 *.pt files (6 lines of code)
  • " *.py" is biggest, containing 71.79% of code.
  • " *.pt" is smallest, containing 0.01% of code.


*.py39792 LOC (71%) 483 files
*.cfg11848 LOC (21%) 21 files
*.yaml2054 LOC (3%) 67 files
*.ipynb1602 LOC (2%) 4 files
*.yml78 LOC (<1%) 4 files
*.m52 LOC (<1%) 1 files
*.pt6 LOC (<1%) 2 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 ".*_test[.].*".
  • 19 files match defined criteria (1,183 lines of code, 2.1% vs. main code):
    • 12 *.py files (1,009 lines of code)
    • 2 *.m files (139 lines of code)
    • 5 *.sh files (35 lines of code)
  • " *.py" is biggest, containing 85.29% of code.
  • " *.sh" is smallest, containing 2.96% of code.


*.py1009 LOC (85%) 12 files
*.m139 LOC (11%) 2 files
*.sh35 LOC (2%) 5 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".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*/[.]gitattributes".
  • 46 files match defined criteria (620 lines of code, 1.1% vs. main code). All matches are in *.sh files.


*.sh620 LOC (100%) 46 files
Other Code
txt
patch
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 ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]dockerignore".
  • 88 files match defined criteria (4,128 lines of code, 7.4% vs. main code):
    • 31 *.md files (2,711 lines of code)
    • 46 *.txt files (1,152 lines of code)
    • 6 *.json files (140 lines of code)
    • 5 *.patch files (125 lines of code)
  • " *.md" is biggest, containing 65.67% of code.
  • " *.patch" is smallest, containing 3.03% of code.


*.md2711 LOC (65%) 31 files
*.txt1152 LOC (27%) 46 files
*.json140 LOC (3%) 6 files
*.patch125 LOC (3%) 5 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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.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
  • *.ipynb 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
  • *.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
  • *.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
  • *.pt files are analyzed with XmlAnalyzer:
    • 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-04-15 01:10