pytorch / xla
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
cc
txt
lds
clang-format
diff
proto
gitmodules
  • 20 extensions are included in analyses: h, cpp, py, cc, sh, md, ipynb, yaml, txt, yml, lds, css, svg, gitignore, clang-format, diff, rst, proto, json, gitmodules
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (8 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (18 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (48 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) (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.

main35965 LOC (58%) 403 files
test17504 LOC (28%) 49 files
generated0 LOC (0%) 0 files
build and deployment379 LOC (<1%) 9 files
other7282 LOC (11%) 22 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 403 files match defined criteria (35,965 lines of code, 100.0% vs. main code):
    • 174 *.cpp files (24,424 lines of code)
    • 54 *.py files (5,628 lines of code)
    • 172 *.h files (5,503 lines of code)
    • 3 *.yaml files (410 lines of code)
  • " *.cpp" is biggest, containing 67.91% of code.
  • " *.yaml" is smallest, containing 1.14% of code.


*.cpp24424 LOC (67%) 174 files
*.py5628 LOC (15%) 54 files
*.h5503 LOC (15%) 172 files
*.yaml410 LOC (1%) 3 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[.].*".
    • files with paths like ".*_tests[.].*".
  • 49 files match defined criteria (17,504 lines of code, 48.7% vs. main code):
    • 12 *.cpp files (11,442 lines of code)
    • 31 *.py files (5,735 lines of code)
    • 2 *.sh files (148 lines of code)
    • 3 *.h files (144 lines of code)
    • 1 *.yaml files (35 lines of code)
  • " *.cpp" is biggest, containing 65.37% of code.
  • " *.yaml" is smallest, containing 0.2% of code.


*.cpp11442 LOC (65%) 12 files
*.py5735 LOC (32%) 31 files
*.sh148 LOC (<1%) 2 files
*.h144 LOC (<1%) 3 files
*.yaml35 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*/[.]gitignore".
  • 9 files match defined criteria (379 lines of code, 1.1% vs. main code). All matches are in *.sh files.


*.sh379 LOC (100%) 9 files
Other Code
diff
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 ".*[.]diff".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 22 files match defined criteria (7,282 lines of code, 20.2% vs. main code):
    • 13 *.ipynb files (6,294 lines of code)
    • 8 *.md files (942 lines of code)
    • 1 *.diff files (46 lines of code)
  • " *.ipynb" is biggest, containing 86.43% of code.
  • " *.diff" is smallest, containing 0.63% of code.


*.ipynb6294 LOC (86%) 13 files
*.md942 LOC (12%) 8 files
*.diff46 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-24 14:32