facebook / hermes
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
cmake
patch
cfg
in
plist
gyp
properties
clang-format
cmd
eslintignore
clang-tidy
webmanifest
podspec
gypi
prettierignore
  • 44 extensions are included in analyses: js, json, h, cpp, c, txt, rs, py, md, java, rst, inc, sh, ts, cc, cmake, toml, patch, cfg, in, plist, gitignore, css, svg, gradle, yml, bat, xml, d, swift, mm, gyp, properties, html, clang-format, cmd, eslintignore, clang-tidy, webmanifest, tsx, podspec, gypi, m, prettierignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (383 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (0 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (20 files).
    • exclude files with path like ".*/flow-typed/.*\.js" (flow-typed) (4 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (4 files).
    • exclude files with path like ".*/prototype(.*)\.js" (Prototype) (2 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (6333 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.

main223075 LOC (79%) 1184 files
test50241 LOC (17%) 1087 files
generated369 LOC (<1%) 3 files
build and deployment921 LOC (<1%) 24 files
other6903 LOC (2%) 143 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
webmanifest
cfg
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1184 files match defined criteria (223,075 lines of code, 100.0% vs. main code):
    • 430 *.cpp files (126,880 lines of code)
    • 361 *.h files (43,104 lines of code)
    • 243 *.js files (23,606 lines of code)
    • 69 *.rs files (17,691 lines of code)
    • 29 *.java files (5,195 lines of code)
    • 22 *.py files (4,716 lines of code)
    • 1 *.mm files (508 lines of code)
    • 4 *.cmake files (487 lines of code)
    • 2 *.inc files (431 lines of code)
    • 5 *.css files (229 lines of code)
    • 12 *.toml files (121 lines of code)
    • 2 *.swift files (36 lines of code)
    • 1 *.webmanifest files (31 lines of code)
    • 2 *.cfg files (28 lines of code)
    • 1 *.in files (12 lines of code)
  • " *.cpp" is biggest, containing 56.88% of code.
  • " *.in" is smallest, containing 0.01% of code.


*.cpp126880 LOC (56%) 430 files
*.h43104 LOC (19%) 361 files
*.js23606 LOC (10%) 243 files
*.rs17691 LOC (7%) 69 files
*.java5195 LOC (2%) 29 files
*.py4716 LOC (2%) 22 files
*.mm508 LOC (<1%) 1 files
*.cmake487 LOC (<1%) 4 files
*.inc431 LOC (<1%) 2 files
*.css229 LOC (<1%) 5 files
*.toml121 LOC (<1%) 12 files
*.swift36 LOC (<1%) 2 files
*.webmanifest31 LOC (<1%) 1 files
*.cfg28 LOC (<1%) 2 files
*.in12 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
in
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]tests[-].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
  • 1087 files match defined criteria (50,241 lines of code, 22.5% vs. main code):
    • 987 *.js files (43,311 lines of code)
    • 31 *.cpp files (3,853 lines of code)
    • 7 *.rs files (1,522 lines of code)
    • 13 *.java files (784 lines of code)
    • 4 *.in files (177 lines of code)
    • 7 *.sh files (177 lines of code)
    • 5 *.h files (161 lines of code)
    • 20 *.ts files (88 lines of code)
    • 5 *.cfg files (83 lines of code)
    • 2 *.py files (56 lines of code)
    • 1 *.mm files (19 lines of code)
    • 3 *.d files (5 lines of code)
    • 1 *.m files (4 lines of code)
    • 1 *.tsx files (1 lines of code)
  • " *.js" is biggest, containing 86.21% of code.
  • " *.tsx" is smallest, containing 0% of code.


*.js43311 LOC (86%) 987 files
*.cpp3853 LOC (7%) 31 files
*.rs1522 LOC (3%) 7 files
*.java784 LOC (1%) 13 files
*.in177 LOC (<1%) 4 files
*.sh177 LOC (<1%) 7 files
*.h161 LOC (<1%) 5 files
*.ts88 LOC (<1%) 20 files
*.cfg83 LOC (<1%) 5 files
*.py56 LOC (<1%) 2 files
*.mm19 LOC (<1%) 1 files
*.d5 LOC (<1%) 3 files
*.m4 LOC (<1%) 1 files
*.tsx1 LOC (<1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/generated/.*".
  • 3 files match defined criteria (369 lines of code, 0.2% vs. main code). All matches are in *.js files.


*.js369 LOC (100%) 3 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
podspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]podspec".
  • 24 files match defined criteria (921 lines of code, 0.4% vs. main code):
    • 14 *.sh files (434 lines of code)
    • 5 *.gradle files (386 lines of code)
    • 1 *.bat files (68 lines of code)
    • 1 *.podspec files (27 lines of code)
    • 3 *.xml files (6 lines of code)
  • " *.sh" is biggest, containing 47.12% of code.
  • " *.xml" is smallest, containing 0.65% of code.


*.sh434 LOC (47%) 14 files
*.gradle386 LOC (41%) 5 files
*.bat68 LOC (7%) 1 files
*.podspec27 LOC (2%) 1 files
*.xml6 LOC (<1%) 3 files
Other Code
txt
plist
patch
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 143 files match defined criteria (6,903 lines of code, 3.1% vs. main code):
    • 77 *.txt files (3,395 lines of code)
    • 39 *.md files (2,916 lines of code)
    • 20 *.json files (461 lines of code)
    • 5 *.plist files (118 lines of code)
    • 1 *.patch files (11 lines of code)
    • 1 *.properties files (2 lines of code)
  • " *.txt" is biggest, containing 49.18% of code.
  • " *.properties" is smallest, containing 0.03% of code.


*.txt3395 LOC (49%) 77 files
*.md2916 LOC (42%) 39 files
*.json461 LOC (6%) 20 files
*.plist118 LOC (1%) 5 files
*.patch11 LOC (<1%) 1 files
*.properties2 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.cpp 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
  • *.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
  • *.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
  • *.rs 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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.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
  • *.mm 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
  • *.cmake 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
  • *.inc files are analyzed with PhpAnalyzer:
    • 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
  • *.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
  • *.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
  • *.swift files are analyzed with SwiftAnalyzer:
    • 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
  • *.webmanifest files are analyzed with JsonAnalyzer:
    • 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
  • *.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-14 23:25