facebook / FAI-PEP
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
  • 11 extensions are included in analyses: py, json, sh, js, css, txt, md, bat, html, svg, gitignore
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (1 file).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (1 file).
    • 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.

main12272 LOC (64%) 165 files
test1082 LOC (5%) 14 files
generated0 LOC (0%) 0 files
build and deployment231 LOC (1%) 19 files
other5406 LOC (28%) 78 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 165 files match defined criteria (12,272 lines of code, 100.0% vs. main code):
    • 157 *.py files (11,733 lines of code)
    • 3 *.js files (287 lines of code)
    • 4 *.html files (145 lines of code)
    • 1 *.css files (107 lines of code)
  • " *.py" is biggest, containing 95.61% of code.
  • " *.css" is smallest, containing 0.87% of code.


*.py11733 LOC (95%) 157 files
*.js287 LOC (2%) 3 files
*.html145 LOC (1%) 4 files
*.css107 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_.*".
  • 14 files match defined criteria (1,082 lines of code, 8.8% vs. main code). All matches are in *.py files.


*.py1082 LOC (100%) 14 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 ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 19 files match defined criteria (231 lines of code, 1.9% vs. main code):
    • 15 *.sh files (197 lines of code)
    • 4 *.bat files (34 lines of code)
  • " *.sh" is biggest, containing 85.28% of code.
  • " *.bat" is smallest, containing 14.72% of code.


*.sh197 LOC (85%) 15 files
*.bat34 LOC (14%) 4 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".
  • 78 files match defined criteria (5,406 lines of code, 44.1% vs. main code):
    • 69 *.json files (2,911 lines of code)
    • 4 *.txt files (2,035 lines of code)
    • 5 *.md files (460 lines of code)
  • " *.json" is biggest, containing 53.85% of code.
  • " *.md" is smallest, containing 8.51% of code.


*.json2911 LOC (53%) 69 files
*.txt2035 LOC (37%) 4 files
*.md460 LOC (8%) 5 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
  • *.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
  • *.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
  • *.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


2022-04-14 23:22