facebook / pyre-check
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
ml
mli
pyi
v
txt
sty
in
patch
tex
mll
vscodeignore
mly
  • 27 extensions are included in analyses: ml, py, mli, pyi, md, json, c, h, v, js, txt, css, sh, yml, gitignore, sty, html, svg, in, ts, patch, yaml, tex, mll, toml, vscodeignore, mly
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/cache/.*" (Caches) (3 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (50 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (24 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (25 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (14 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.

main122743 LOC (43%) 706 files
test152724 LOC (54%) 549 files
generated0 LOC (0%) 0 files
build and deployment57 LOC (<1%) 3 files
other3887 LOC (1%) 84 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ml
mli
pyi
mly
mll
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 706 files match defined criteria (122,743 lines of code, 100.0% vs. main code):
    • 222 *.ml files (85,035 lines of code)
    • 138 *.py files (20,289 lines of code)
    • 173 *.mli files (10,699 lines of code)
    • 9 *.c files (2,193 lines of code)
    • 155 *.pyi files (1,892 lines of code)
    • 1 *.mly files (1,796 lines of code)
    • 1 *.mll files (452 lines of code)
    • 1 *.in files (184 lines of code)
    • 3 *.h files (84 lines of code)
    • 2 *.ts files (84 lines of code)
    • 1 *.toml files (35 lines of code)
  • " *.ml" is biggest, containing 69.28% of code.
  • " *.toml" is smallest, containing 0.03% of code.


*.ml85035 LOC (69%) 222 files
*.py20289 LOC (16%) 138 files
*.mli10699 LOC (8%) 173 files
*.c2193 LOC (1%) 9 files
*.pyi1892 LOC (1%) 155 files
*.mly1796 LOC (1%) 1 files
*.mll452 LOC (<1%) 1 files
*.in184 LOC (<1%) 1 files
*.h84 LOC (<1%) 3 files
*.ts84 LOC (<1%) 2 files
*.toml35 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
ml
mli
pyi
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
  • 549 files match defined criteria (152,724 lines of code, 124.4% vs. main code):
    • 168 *.ml files (129,211 lines of code)
    • 214 *.py files (22,382 lines of code)
    • 139 *.mli files (1,012 lines of code)
    • 28 *.pyi files (119 lines of code)
  • " *.ml" is biggest, containing 84.6% of code.
  • " *.pyi" is smallest, containing 0.08% of code.


*.ml129211 LOC (84%) 168 files
*.py22382 LOC (14%) 214 files
*.mli1012 LOC (<1%) 139 files
*.pyi119 LOC (<1%) 28 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 ".*[.]sh".
  • 3 files match defined criteria (57 lines of code, 0.0% vs. main code). All matches are in *.sh files.


*.sh57 LOC (100%) 3 files
Other Code
txt
pyi
patch
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]vscodeignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/INSTALL[.][a-z0-9]+".
    • files with paths like ".*[.]patch".
  • 84 files match defined criteria (3,887 lines of code, 3.2% vs. main code):
    • 19 *.json files (1,054 lines of code)
    • 20 *.md files (884 lines of code)
    • 6 *.js files (683 lines of code)
    • 6 *.txt files (459 lines of code)
    • 20 *.py files (358 lines of code)
    • 3 *.css files (252 lines of code)
    • 7 *.pyi files (128 lines of code)
    • 1 *.patch files (59 lines of code)
    • 2 *.sh files (10 lines of code)
  • " *.json" is biggest, containing 27.12% of code.
  • " *.sh" is smallest, containing 0.26% of code.


*.json1054 LOC (27%) 19 files
*.md884 LOC (22%) 20 files
*.js683 LOC (17%) 6 files
*.txt459 LOC (11%) 6 files
*.py358 LOC (9%) 20 files
*.css252 LOC (6%) 3 files
*.pyi128 LOC (3%) 7 files
*.patch59 LOC (1%) 1 files
*.sh10 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.ml 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
  • *.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
  • *.mli 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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.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
  • *.mly 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
  • *.mll 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
  • *.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
  • *.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
  • *.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
  • *.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-14 23:21