pytorch / captum
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
pt
cfg
gitattributes
txt
  • 21 extensions are included in analyses: py, rst, md, ipynb, tsx, js, ts, css, json, pt, sh, svg, yml, cfg, gitignore, gitattributes, toml, txt, bat, html, yaml
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (10 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 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 ".*\.d\.ts" (Typescript definition 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.

main17643 LOC (49%) 165 files
test16231 LOC (45%) 95 files
generated0 LOC (0%) 0 files
build and deployment387 LOC (1%) 8 files
other1249 LOC (3%) 49 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
pt
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 165 files match defined criteria (17,643 lines of code, 100.0% vs. main code):
    • 117 *.py files (13,047 lines of code)
    • 7 *.css files (1,800 lines of code)
    • 12 *.js files (958 lines of code)
    • 15 *.tsx files (905 lines of code)
    • 1 *.ipynb files (567 lines of code)
    • 2 *.pt files (225 lines of code)
    • 7 *.ts files (110 lines of code)
    • 1 *.html files (12 lines of code)
    • 1 *.cfg files (9 lines of code)
    • 1 *.yml files (6 lines of code)
    • 1 *.toml files (4 lines of code)
  • " *.py" is biggest, containing 73.95% of code.
  • " *.toml" is smallest, containing 0.02% of code.


*.py13047 LOC (73%) 117 files
*.css1800 LOC (10%) 7 files
*.js958 LOC (5%) 12 files
*.tsx905 LOC (5%) 15 files
*.ipynb567 LOC (3%) 1 files
*.pt225 LOC (1%) 2 files
*.ts110 LOC (<1%) 7 files
*.html12 LOC (<1%) 1 files
*.cfg9 LOC (<1%) 1 files
*.yml6 LOC (<1%) 1 files
*.toml4 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]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
  • 95 files match defined criteria (16,231 lines of code, 92.0% vs. main code):
    • 94 *.py files (16,225 lines of code)
    • 1 *.js files (6 lines of code)
  • " *.py" is biggest, containing 99.96% of code.
  • " *.js" is smallest, containing 0.04% of code.


*.py16225 LOC (99%) 94 files
*.js6 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 ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 8 files match defined criteria (387 lines of code, 2.2% vs. main code):
    • 6 *.sh files (291 lines of code)
    • 1 *.js files (69 lines of code)
    • 1 *.bat files (27 lines of code)
  • " *.sh" is biggest, containing 75.19% of code.
  • " *.bat" is smallest, containing 6.98% of code.


*.sh291 LOC (75%) 6 files
*.js69 LOC (17%) 1 files
*.bat27 LOC (6%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]txt".
  • 49 files match defined criteria (1,249 lines of code, 7.1% vs. main code):
    • 9 *.md files (591 lines of code)
    • 31 *.rst files (381 lines of code)
    • 7 *.json files (263 lines of code)
    • 2 *.svg files (14 lines of code)
  • " *.md" is biggest, containing 47.32% of code.
  • " *.svg" is smallest, containing 1.12% of code.


*.md591 LOC (47%) 9 files
*.rst381 LOC (30%) 31 files
*.json263 LOC (21%) 7 files
*.svg14 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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-04-15 01:17