facebookresearch / ReAgent
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
cfg
ini
toml
gitmodules
  • 18 extensions are included in analyses: py, rst, cpp, h, yaml, json, scala, ipynb, txt, md, cfg, sh, yml, ini, gitignore, toml, xml, gitmodules
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (76 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) (3 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.

main33074 LOC (62%) 387 files
test16367 LOC (31%) 151 files
generated0 LOC (0%) 0 files
build and deployment17 LOC (<1%) 1 files
other3229 LOC (6%) 31 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cfg
toml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 387 files match defined criteria (33,074 lines of code, 100.0% vs. main code):
    • 323 *.py files (30,122 lines of code)
    • 28 *.cpp files (1,191 lines of code)
    • 27 *.h files (888 lines of code)
    • 5 *.scala files (691 lines of code)
    • 2 *.yaml files (120 lines of code)
    • 1 *.cfg files (54 lines of code)
    • 1 *.toml files (8 lines of code)
  • " *.py" is biggest, containing 91.07% of code.
  • " *.toml" is smallest, containing 0.02% of code.


*.py30122 LOC (91%) 323 files
*.cpp1191 LOC (3%) 28 files
*.h888 LOC (2%) 27 files
*.scala691 LOC (2%) 5 files
*.yaml120 LOC (<1%) 2 files
*.cfg54 LOC (<1%) 1 files
*.toml8 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_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*[.]tests[.].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[.]test[.].*".
  • 151 files match defined criteria (16,367 lines of code, 49.5% vs. main code):
    • 108 *.py files (13,325 lines of code)
    • 4 *.scala files (1,588 lines of code)
    • 25 *.yaml files (930 lines of code)
    • 13 *.cpp files (489 lines of code)
    • 1 *.h files (35 lines of code)
  • " *.py" is biggest, containing 81.41% of code.
  • " *.h" is smallest, containing 0.21% of code.


*.py13325 LOC (81%) 108 files
*.scala1588 LOC (9%) 4 files
*.yaml930 LOC (5%) 25 files
*.cpp489 LOC (2%) 13 files
*.h35 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".
    • files with paths like ".*/pom[.]xml".
  • 1 file matches defined criteria (17 lines of code, 0.1% vs. main code). All matches are in *.sh files.


*.sh17 LOC (100%) 1 files
Other Code
ini
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 31 files match defined criteria (3,229 lines of code, 9.8% vs. main code):
    • 3 *.ipynb files (1,953 lines of code)
    • 18 *.json files (529 lines of code)
    • 1 *.xml files (415 lines of code)
    • 4 *.md files (136 lines of code)
    • 1 *.ini files (84 lines of code)
    • 3 *.py files (73 lines of code)
    • 1 *.yaml files (39 lines of code)
  • " *.ipynb" is biggest, containing 60.48% of code.
  • " *.yaml" is smallest, containing 1.21% of code.


*.ipynb1953 LOC (60%) 3 files
*.json529 LOC (16%) 18 files
*.xml415 LOC (12%) 1 files
*.md136 LOC (4%) 4 files
*.ini84 LOC (2%) 1 files
*.py73 LOC (2%) 3 files
*.yaml39 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
  • *.scala files are analyzed with ScalaAnalyzer:
    • 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
  • *.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
  • *.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-25 19:32