facebookresearch / beanmachine
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
mdx
toml
txt
pyi
in
cfg
dockerignore
prettierignore
  • 21 extensions are included in analyses: py, cpp, h, md, ipynb, json, svg, js, yml, mdx, gitignore, jsx, css, toml, txt, pyi, in, cfg, dockerignore, bat, prettierignore
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (15 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (26 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.

main35083 LOC (60%) 332 files
test22456 LOC (38%) 192 files
generated0 LOC (0%) 0 files
build and deployment29 LOC (<1%) 1 files
other847 LOC (1%) 26 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
pyi
toml
cfg
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 332 files match defined criteria (35,083 lines of code, 100.0% vs. main code):
    • 194 *.py files (23,218 lines of code)
    • 64 *.cpp files (8,199 lines of code)
    • 60 *.h files (2,767 lines of code)
    • 1 *.pyi files (368 lines of code)
    • 4 *.js files (281 lines of code)
    • 3 *.jsx files (77 lines of code)
    • 2 *.toml files (68 lines of code)
    • 1 *.cfg files (59 lines of code)
    • 2 *.css files (45 lines of code)
    • 1 *.in files (1 lines of code)
  • " *.py" is biggest, containing 66.18% of code.
  • " *.in" is smallest, containing 0% of code.


*.py23218 LOC (66%) 194 files
*.cpp8199 LOC (23%) 64 files
*.h2767 LOC (7%) 60 files
*.pyi368 LOC (1%) 1 files
*.js281 LOC (<1%) 4 files
*.jsx77 LOC (<1%) 3 files
*.toml68 LOC (<1%) 2 files
*.cfg59 LOC (<1%) 1 files
*.css45 LOC (<1%) 2 files
*.in1 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_.*".
  • 192 files match defined criteria (22,456 lines of code, 64.0% vs. main code):
    • 157 *.py files (17,027 lines of code)
    • 34 *.cpp files (5,409 lines of code)
    • 1 *.h files (20 lines of code)
  • " *.py" is biggest, containing 75.82% of code.
  • " *.h" is smallest, containing 0.09% of code.


*.py17027 LOC (75%) 157 files
*.cpp5409 LOC (24%) 34 files
*.h20 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]bat".
  • 1 file matches defined criteria (29 lines of code, 0.1% vs. main code). All matches are in *.bat files.


*.bat29 LOC (100%) 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 ".*/[.]prettierignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]mdx".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 26 files match defined criteria (847 lines of code, 2.4% vs. main code):
    • 1 *.ipynb files (410 lines of code)
    • 13 *.md files (199 lines of code)
    • 8 *.py files (97 lines of code)
    • 2 *.json files (77 lines of code)
    • 2 *.svg files (64 lines of code)
  • " *.ipynb" is biggest, containing 48.41% of code.
  • " *.svg" is smallest, containing 7.56% of code.


*.ipynb410 LOC (48%) 1 files
*.md199 LOC (23%) 13 files
*.py97 LOC (11%) 8 files
*.json77 LOC (9%) 2 files
*.svg64 LOC (7%) 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
  • *.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
  • *.pyi 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
  • *.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
  • *.jsx 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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-25 19:44