pytorch / fairseq
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
pyx
cfg
cuh
lua
cc
toml
gitmodules
  • 22 extensions are included in analyses: py, yaml, md, sh, rst, cpp, txt, cu, yml, gitignore, h, pyx, perl, cfg, cuh, lua, css, bat, json, cc, toml, gitmodules
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (17 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (30 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (0 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) (4 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.

main65518 LOC (49%) 453 files
test9718 LOC (7%) 76 files
generated0 LOC (0%) 0 files
build and deployment34 LOC (<1%) 2 files
other58096 LOC (43%) 636 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cu
pyx
cuh
lua
cfg
toml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 453 files match defined criteria (65,518 lines of code, 100.0% vs. main code):
    • 417 *.py files (63,012 lines of code)
    • 5 *.cu files (1,035 lines of code)
    • 9 *.cpp files (589 lines of code)
    • 13 *.yaml files (357 lines of code)
    • 2 *.pyx files (285 lines of code)
    • 2 *.cuh files (111 lines of code)
    • 2 *.lua files (109 lines of code)
    • 1 *.h files (13 lines of code)
    • 1 *.cfg files (4 lines of code)
    • 1 *.toml files (3 lines of code)
  • " *.py" is biggest, containing 96.18% of code.
  • " *.toml" is smallest, containing 0% of code.


*.py63012 LOC (96%) 417 files
*.cu1035 LOC (1%) 5 files
*.cpp589 LOC (<1%) 9 files
*.yaml357 LOC (<1%) 13 files
*.pyx285 LOC (<1%) 2 files
*.cuh111 LOC (<1%) 2 files
*.lua109 LOC (<1%) 2 files
*.h13 LOC (<1%) 1 files
*.cfg4 LOC (<1%) 1 files
*.toml3 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 ".*_test[.].*".
  • 76 files match defined criteria (9,718 lines of code, 14.8% vs. main code):
    • 74 *.py files (9,679 lines of code)
    • 1 *.sh files (21 lines of code)
    • 1 *.yaml files (18 lines of code)
  • " *.py" is biggest, containing 99.6% of code.
  • " *.yaml" is smallest, containing 0.19% of code.


*.py9679 LOC (99%) 74 files
*.sh21 LOC (<1%) 1 files
*.yaml18 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 2 files match defined criteria (34 lines of code, 0.1% vs. main code). All matches are in *.sh files.


*.sh34 LOC (100%) 2 files
Other Code
cu
cc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ee]xamples/.*".
  • 636 files match defined criteria (58,096 lines of code, 88.7% vs. main code):
    • 344 *.py files (40,912 lines of code)
    • 97 *.md files (8,556 lines of code)
    • 125 *.yaml files (4,197 lines of code)
    • 62 *.sh files (3,783 lines of code)
    • 1 *.cu files (316 lines of code)
    • 2 *.cpp files (142 lines of code)
    • 2 *.perl files (112 lines of code)
    • 1 *.cc files (63 lines of code)
    • 2 *.h files (15 lines of code)
  • " *.py" is biggest, containing 70.42% of code.
  • " *.h" is smallest, containing 0.03% of code.


*.py40912 LOC (70%) 344 files
*.md8556 LOC (14%) 97 files
*.yaml4197 LOC (7%) 125 files
*.sh3783 LOC (6%) 62 files
*.cu316 LOC (<1%) 1 files
*.cpp142 LOC (<1%) 2 files
*.perl112 LOC (<1%) 2 files
*.cc63 LOC (<1%) 1 files
*.h15 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
  • *.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
  • *.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
  • *.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
  • *.pyx 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
  • *.cuh 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
  • *.lua files are analyzed with LuaAnalyzer:
    • 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
  • *.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
  • *.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:21