pytorch / vision
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
cu
ini
in
properties
ps1
plist
storyboard
pt
gitattributes
podspec
cfg
clang-format
toml
cmake
  • 36 extensions are included in analyses: py, cpp, h, sh, rst, bat, md, yml, xml, txt, yaml, cu, gradle, json, java, ini, in, gitignore, properties, ps1, plist, mm, svg, storyboard, m, css, pt, gitattributes, ipynb, html, podspec, cfg, clang-format, toml, cmake, bash
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (41 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (19 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (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.

main51444 LOC (74%) 415 files
test15133 LOC (21%) 53 files
generated0 LOC (0%) 0 files
build and deployment1017 LOC (1%) 29 files
other1626 LOC (2%) 39 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cu
cmake
ps1
in
cfg
toml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 415 files match defined criteria (51,444 lines of code, 100.0% vs. main code):
    • 267 *.py files (35,140 lines of code)
    • 65 *.cpp files (10,180 lines of code)
    • 7 *.cu files (3,156 lines of code)
    • 58 *.h files (2,116 lines of code)
    • 1 *.bash files (305 lines of code)
    • 1 *.cmake files (175 lines of code)
    • 6 *.yaml files (160 lines of code)
    • 2 *.mm files (97 lines of code)
    • 2 *.ps1 files (42 lines of code)
    • 2 *.m files (27 lines of code)
    • 2 *.in files (19 lines of code)
    • 1 *.cfg files (18 lines of code)
    • 1 *.toml files (9 lines of code)
  • " *.py" is biggest, containing 68.31% of code.
  • " *.toml" is smallest, containing 0.02% of code.


*.py35140 LOC (68%) 267 files
*.cpp10180 LOC (19%) 65 files
*.cu3156 LOC (6%) 7 files
*.h2116 LOC (4%) 58 files
*.bash305 LOC (<1%) 1 files
*.cmake175 LOC (<1%) 1 files
*.yaml160 LOC (<1%) 6 files
*.mm97 LOC (<1%) 2 files
*.ps142 LOC (<1%) 2 files
*.m27 LOC (<1%) 2 files
*.in19 LOC (<1%) 2 files
*.cfg18 LOC (<1%) 1 files
*.toml9 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 ".*/test_.*".
    • files with paths like ".*_test[.].*".
  • 53 files match defined criteria (15,133 lines of code, 29.4% vs. main code):
    • 43 *.py files (13,810 lines of code)
    • 5 *.cpp files (649 lines of code)
    • 4 *.java files (550 lines of code)
    • 1 *.gradle files (124 lines of code)
  • " *.py" is biggest, containing 91.26% of code.
  • " *.gradle" is smallest, containing 0.82% of code.


*.py13810 LOC (91%) 43 files
*.cpp649 LOC (4%) 5 files
*.java550 LOC (3%) 4 files
*.gradle124 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
podspec
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 ".*[.]podspec".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*/[.]gitattributes".
  • 29 files match defined criteria (1,017 lines of code, 2.0% vs. main code):
    • 13 *.bat files (530 lines of code)
    • 10 *.sh files (339 lines of code)
    • 5 *.gradle files (125 lines of code)
    • 1 *.podspec files (23 lines of code)
  • " *.bat" is biggest, containing 52.11% of code.
  • " *.podspec" is smallest, containing 2.26% of code.


*.bat530 LOC (52%) 13 files
*.sh339 LOC (33%) 10 files
*.gradle125 LOC (12%) 5 files
*.podspec23 LOC (2%) 1 files
Other Code
storyboard
ini
plist
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 ".*[.]txt".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 39 files match defined criteria (1,626 lines of code, 3.2% vs. main code):
    • 12 *.md files (945 lines of code)
    • 5 *.rst files (175 lines of code)
    • 3 *.json files (115 lines of code)
    • 2 *.storyboard files (109 lines of code)
    • 3 *.ini files (85 lines of code)
    • 8 *.xml files (79 lines of code)
    • 2 *.plist files (53 lines of code)
    • 1 *.cpp files (32 lines of code)
    • 2 *.properties files (24 lines of code)
    • 1 *.py files (9 lines of code)
  • " *.md" is biggest, containing 58.12% of code.
  • " *.py" is smallest, containing 0.55% of code.


*.md945 LOC (58%) 12 files
*.rst175 LOC (10%) 5 files
*.json115 LOC (7%) 3 files
*.storyboard109 LOC (6%) 2 files
*.ini85 LOC (5%) 3 files
*.xml79 LOC (4%) 8 files
*.plist53 LOC (3%) 2 files
*.cpp32 LOC (1%) 1 files
*.properties24 LOC (1%) 2 files
*.py9 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
  • *.cu 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
  • *.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
  • *.cmake 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
  • *.mm 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-24 14:18