facebookincubator / RapiD
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
npmignore
arcconfig
gitattributes
editorconfig
npmrc
  • 19 extensions are included in analyses: js, svg, json, css, md, html, yml, txt, xml, yaml, npmignore, gitignore, arcconfig, py, gitattributes, cjs, sh, editorconfig, npmrc
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (10 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (81 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (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.

main68782 LOC (72%) 408 files
test22143 LOC (23%) 118 files
generated0 LOC (0%) 0 files
build and deployment23 LOC (<1%) 1 files
other4544 LOC (4%) 284 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 ".*".
  • 408 files match defined criteria (68,782 lines of code, 100.0% vs. main code):
    • 386 *.js files (57,511 lines of code)
    • 17 *.css files (8,539 lines of code)
    • 2 *.yaml files (2,558 lines of code)
    • 1 *.html files (64 lines of code)
    • 1 *.cjs files (58 lines of code)
    • 1 *.py files (52 lines of code)
  • " *.js" is biggest, containing 83.61% of code.
  • " *.py" is smallest, containing 0.08% of code.


*.js57511 LOC (83%) 386 files
*.css8539 LOC (12%) 17 files
*.yaml2558 LOC (3%) 2 files
*.html64 LOC (<1%) 1 files
*.cjs58 LOC (<1%) 1 files
*.py52 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]est/.*".
  • 118 files match defined criteria (22,143 lines of code, 32.2% vs. main code):
    • 115 *.js files (21,887 lines of code)
    • 1 *.html files (185 lines of code)
    • 2 *.xml files (71 lines of code)
  • " *.js" is biggest, containing 98.84% of code.
  • " *.xml" is smallest, containing 0.32% of code.


*.js21887 LOC (98%) 115 files
*.html185 LOC (<1%) 1 files
*.xml71 LOC (<1%) 2 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 ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitattributes".
  • 1 file matches defined criteria (23 lines of code, 0.0% vs. main code). All matches are in *.sh files.


*.sh23 LOC (100%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]gitignore".
  • 284 files match defined criteria (4,544 lines of code, 6.6% vs. main code):
    • 15 *.json files (2,333 lines of code)
    • 16 *.md files (1,179 lines of code)
    • 253 *.svg files (1,032 lines of code)
  • " *.json" is biggest, containing 51.34% of code.
  • " *.svg" is smallest, containing 22.71% of code.


*.json2333 LOC (51%) 15 files
*.md1179 LOC (25%) 16 files
*.svg1032 LOC (22%) 253 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.yaml files are analyzed with YamlAnalyzer:
    • 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
  • *.cjs 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
  • *.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


2022-04-15 05:00