pytorch / text
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
pt
ini
gitattributes
jsonl
cfg
in
gitmodules
  • 23 extensions are included in analyses: py, rst, sh, txt, cpp, md, h, bat, yml, pt, yaml, json, ini, svg, css, gitattributes, jsonl, html, cfg, in, gitignore, bash, gitmodules
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (31 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (23 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (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) (6 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.

main6762 LOC (65%) 94 files
test2531 LOC (24%) 39 files
generated0 LOC (0%) 0 files
build and deployment167 LOC (1%) 9 files
other895 LOC (8%) 16 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 94 files match defined criteria (6,762 lines of code, 100.0% vs. main code):
    • 70 *.py files (4,974 lines of code)
    • 9 *.cpp files (1,238 lines of code)
    • 8 *.h files (283 lines of code)
    • 1 *.bash files (143 lines of code)
    • 4 *.yaml files (115 lines of code)
    • 1 *.yml files (7 lines of code)
    • 1 *.cfg files (2 lines of code)
  • " *.py" is biggest, containing 73.56% of code.
  • " *.cfg" is smallest, containing 0.03% of code.


*.py4974 LOC (73%) 70 files
*.cpp1238 LOC (18%) 9 files
*.h283 LOC (4%) 8 files
*.bash143 LOC (2%) 1 files
*.yaml115 LOC (1%) 4 files
*.yml7 LOC (<1%) 1 files
*.cfg2 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
pt
jsonl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
  • 39 files match defined criteria (2,531 lines of code, 37.4% vs. main code):
    • 36 *.py files (2,164 lines of code)
    • 2 *.pt files (321 lines of code)
    • 1 *.jsonl files (46 lines of code)
  • " *.py" is biggest, containing 85.5% of code.
  • " *.jsonl" is smallest, containing 1.82% of code.


*.py2164 LOC (85%) 36 files
*.pt321 LOC (12%) 2 files
*.jsonl46 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 ".*[.]bat".
    • 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".
  • 9 files match defined criteria (167 lines of code, 2.5% vs. main code):
    • 5 *.bat files (135 lines of code)
    • 4 *.sh files (32 lines of code)
  • " *.bat" is biggest, containing 80.84% of code.
  • " *.sh" is smallest, containing 19.16% of code.


*.bat135 LOC (80%) 5 files
*.sh32 LOC (19%) 4 files
Other Code
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
  • 16 files match defined criteria (895 lines of code, 13.2% vs. main code):
    • 8 *.py files (618 lines of code)
    • 4 *.md files (161 lines of code)
    • 1 *.rst files (104 lines of code)
    • 2 *.ini files (7 lines of code)
    • 1 *.sh files (5 lines of code)
  • " *.py" is biggest, containing 69.05% of code.
  • " *.sh" is smallest, containing 0.56% of code.


*.py618 LOC (69%) 8 files
*.md161 LOC (17%) 4 files
*.rst104 LOC (11%) 1 files
*.ini7 LOC (<1%) 2 files
*.sh5 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
  • *.cpp 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
  • *.bash files are analyzed with ShellAnalyzer:
    • 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
  • *.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
  • *.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


2022-01-24 14:19