facebookincubator / flowtorch
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
txt
in
cfg
bib
  • 15 extensions are included in analyses: py, svg, md, js, css, mdx, yml, gitignore, toml, txt, json, in, cfg, tsx, bib
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (30 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 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).
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.

main3887 LOC (26%) 74 files
test305 LOC (2%) 6 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other10431 LOC (71%) 37 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
bib
cfg
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 74 files match defined criteria (3,887 lines of code, 100.0% vs. main code):
    • 43 *.py files (2,433 lines of code)
    • 11 *.css files (699 lines of code)
    • 14 *.js files (550 lines of code)
    • 1 *.bib files (138 lines of code)
    • 1 *.tsx files (26 lines of code)
    • 2 *.toml files (26 lines of code)
    • 1 *.cfg files (8 lines of code)
    • 1 *.in files (7 lines of code)
  • " *.py" is biggest, containing 62.59% of code.
  • " *.in" is smallest, containing 0.18% of code.


*.py2433 LOC (62%) 43 files
*.css699 LOC (17%) 11 files
*.js550 LOC (14%) 14 files
*.bib138 LOC (3%) 1 files
*.tsx26 LOC (<1%) 1 files
*.toml26 LOC (<1%) 2 files
*.cfg8 LOC (<1%) 1 files
*.in7 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_.*".
  • 6 files match defined criteria (305 lines of code, 7.8% vs. main code). All matches are in *.py files.


*.py305 LOC (100%) 6 files
Other Code
txt
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 ".*[.]mdx".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 37 files match defined criteria (10,431 lines of code, 268.4% vs. main code):
    • 25 *.svg files (9,881 lines of code)
    • 5 *.md files (144 lines of code)
    • 2 *.json files (121 lines of code)
    • 2 *.js files (92 lines of code)
    • 1 *.py files (91 lines of code)
    • 1 *.css files (85 lines of code)
    • 1 *.txt files (17 lines of code)
  • " *.svg" is biggest, containing 94.73% of code.
  • " *.txt" is smallest, containing 0.16% of code.


*.svg9881 LOC (94%) 25 files
*.md144 LOC (1%) 5 files
*.json121 LOC (1%) 2 files
*.js92 LOC (<1%) 2 files
*.py91 LOC (<1%) 1 files
*.css85 LOC (<1%) 1 files
*.txt17 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
  • *.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
  • *.bib 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
  • *.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
  • *.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
  • *.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-04-15 05:06