facebook / sapp
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
pyi
txt
snap
in
cfg
eslintignore
  • 17 extensions are included in analyses: pyi, py, js, md, css, txt, json, yml, snap, gitignore, sh, svg, in, cfg, toml, html, eslintignore
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (9 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.

main22745 LOC (74%) 207 files
test6590 LOC (21%) 19 files
generated0 LOC (0%) 0 files
build and deployment475 LOC (1%) 3 files
other623 LOC (2%) 10 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
pyi
cfg
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 207 files match defined criteria (22,745 lines of code, 100.0% vs. main code):
    • 127 *.pyi files (9,896 lines of code)
    • 51 *.py files (9,221 lines of code)
    • 22 *.js files (3,496 lines of code)
    • 4 *.css files (110 lines of code)
    • 1 *.html files (19 lines of code)
    • 1 *.cfg files (2 lines of code)
    • 1 *.in files (1 lines of code)
  • " *.pyi" is biggest, containing 43.51% of code.
  • " *.in" is smallest, containing 0% of code.


*.pyi9896 LOC (43%) 127 files
*.py9221 LOC (40%) 51 files
*.js3496 LOC (15%) 22 files
*.css110 LOC (<1%) 4 files
*.html19 LOC (<1%) 1 files
*.cfg2 LOC (<1%) 1 files
*.in1 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
snap
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 ".*[.]snap".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
  • 19 files match defined criteria (6,590 lines of code, 29.0% vs. main code):
    • 14 *.py files (5,739 lines of code)
    • 1 *.snap files (515 lines of code)
    • 4 *.js files (336 lines of code)
  • " *.py" is biggest, containing 87.09% of code.
  • " *.js" is smallest, containing 5.1% of code.


*.py5739 LOC (87%) 14 files
*.snap515 LOC (7%) 1 files
*.js336 LOC (5%) 4 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 ".*([.]|/)webpack([.]|/).*".
    • 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 (475 lines of code, 2.1% vs. main code):
    • 1 *.js files (441 lines of code)
    • 2 *.sh files (34 lines of code)
  • " *.js" is biggest, containing 92.84% of code.
  • " *.sh" is smallest, containing 7.16% of code.


*.js441 LOC (92%) 1 files
*.sh34 LOC (7%) 2 files
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]eslintignore".
  • 10 files match defined criteria (623 lines of code, 2.7% vs. main code):
    • 4 *.md files (363 lines of code)
    • 3 *.json files (239 lines of code)
    • 3 *.txt files (21 lines of code)
  • " *.md" is biggest, containing 58.27% of code.
  • " *.txt" is smallest, containing 3.37% of code.


*.md363 LOC (58%) 4 files
*.json239 LOC (38%) 3 files
*.txt21 LOC (3%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.html 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
  • *.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 00:47