facebook / metro
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
npmignore
snap
watchmanconfig
txt
eslintignore
  • 14 extensions are included in analyses: js, json, md, npmignore, snap, yml, svg, gitignore, css, scss, watchmanconfig, txt, eslintignore, ts
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (30 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (8 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (1 file).
    • exclude files with path like ".*/flow-typed/.*\.js" (flow-typed) (8 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.

main22831 LOC (46%) 241 files
test25526 LOC (51%) 115 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other1236 LOC (2%) 52 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 ".*".
  • 241 files match defined criteria (22,831 lines of code, 100.0% vs. main code):
    • 237 *.js files (22,713 lines of code)
    • 1 *.yml files (70 lines of code)
    • 1 *.css files (23 lines of code)
    • 1 *.scss files (19 lines of code)
    • 1 *.ts files (6 lines of code)
  • " *.js" is biggest, containing 99.48% of code.
  • " *.ts" is smallest, containing 0.03% of code.


*.js22713 LOC (99%) 237 files
*.yml70 LOC (<1%) 1 files
*.css23 LOC (<1%) 1 files
*.scss19 LOC (<1%) 1 files
*.ts6 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 ".*__tests__.*".
    • files with paths like ".*/__mocks?__/.*".
    • files with paths like ".*[.]snap".
  • 115 files match defined criteria (25,526 lines of code, 111.8% vs. main code):
    • 96 *.js files (22,791 lines of code)
    • 19 *.snap files (2,735 lines of code)
  • " *.js" is biggest, containing 89.29% of code.
  • " *.snap" is smallest, containing 10.71% of code.


*.js22791 LOC (89%) 96 files
*.snap2735 LOC (10%) 19 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]eslintignore".
  • 52 files match defined criteria (1,236 lines of code, 5.4% vs. main code):
    • 38 *.json files (1,014 lines of code)
    • 14 *.md files (222 lines of code)
  • " *.json" is biggest, containing 82.04% of code.
  • " *.md" is smallest, containing 17.96% of code.


*.json1014 LOC (82%) 38 files
*.md222 LOC (17%) 14 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
  • *.yml 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
  • *.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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.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


2022-04-14 23:08