facebook / redex
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
pro
txt
m4
cmake
cfg
proto
clang-format
properties
dockerignore
in
s
clang-tidy
  • 28 extensions are included in analyses: cpp, h, java, xml, py, pro, txt, sh, md, kt, m4, json, gradle, js, yml, cmake, cfg, proto, inc, gitignore, clang-format, properties, css, dockerignore, in, s, pl, clang-tidy
  • 6 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 ".*/testdata/.*" (Test data) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (9 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (2 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (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.

main194972 LOC (69%) 914 files
test82684 LOC (29%) 518 files
generated0 LOC (0%) 0 files
build and deployment171 LOC (<1%) 7 files
other1926 LOC (<1%) 85 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
cmake
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 914 files match defined criteria (194,972 lines of code, 100.0% vs. main code):
    • 382 *.cpp files (138,825 lines of code)
    • 482 *.h files (43,217 lines of code)
    • 33 *.py files (10,861 lines of code)
    • 3 *.proto files (868 lines of code)
    • 4 *.cmake files (645 lines of code)
    • 4 *.js files (301 lines of code)
    • 1 *.inc files (134 lines of code)
    • 1 *.css files (77 lines of code)
    • 3 *.java files (29 lines of code)
    • 1 *.in files (15 lines of code)
  • " *.cpp" is biggest, containing 71.2% of code.
  • " *.in" is smallest, containing 0.01% of code.


*.cpp138825 LOC (71%) 382 files
*.h43217 LOC (22%) 482 files
*.py10861 LOC (5%) 33 files
*.proto868 LOC (<1%) 3 files
*.cmake645 LOC (<1%) 4 files
*.js301 LOC (<1%) 4 files
*.inc134 LOC (<1%) 1 files
*.css77 LOC (<1%) 1 files
*.java29 LOC (<1%) 3 files
*.in15 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
pro
cfg
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 ".*[-]test[-].*".
    • files with paths like ".*_tests[.].*".
  • 518 files match defined criteria (82,684 lines of code, 42.4% vs. main code):
    • 270 *.cpp files (62,427 lines of code)
    • 159 *.java files (17,519 lines of code)
    • 15 *.h files (796 lines of code)
    • 26 *.pro files (508 lines of code)
    • 11 *.sh files (397 lines of code)
    • 9 *.py files (360 lines of code)
    • 10 *.kt files (280 lines of code)
    • 13 *.xml files (242 lines of code)
    • 3 *.cfg files (85 lines of code)
    • 1 *.pl files (47 lines of code)
    • 1 *.inc files (23 lines of code)
  • " *.cpp" is biggest, containing 75.5% of code.
  • " *.inc" is smallest, containing 0.03% of code.


*.cpp62427 LOC (75%) 270 files
*.java17519 LOC (21%) 159 files
*.h796 LOC (<1%) 15 files
*.pro508 LOC (<1%) 26 files
*.sh397 LOC (<1%) 11 files
*.py360 LOC (<1%) 9 files
*.kt280 LOC (<1%) 10 files
*.xml242 LOC (<1%) 13 files
*.cfg85 LOC (<1%) 3 files
*.pl47 LOC (<1%) 1 files
*.inc23 LOC (<1%) 1 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 ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/docker[-]compose[.]yml".
  • 7 files match defined criteria (171 lines of code, 0.1% vs. main code):
    • 6 *.sh files (154 lines of code)
    • 1 *.yml files (17 lines of code)
  • " *.sh" is biggest, containing 90.06% of code.
  • " *.yml" is smallest, containing 9.94% of code.


*.sh154 LOC (90%) 6 files
*.yml17 LOC (9%) 1 files
Other Code
txt
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 ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Ee]xamples/.*".
  • 85 files match defined criteria (1,926 lines of code, 1.0% vs. main code):
    • 33 *.xml files (486 lines of code)
    • 24 *.java files (479 lines of code)
    • 7 *.md files (406 lines of code)
    • 4 *.txt files (209 lines of code)
    • 6 *.json files (137 lines of code)
    • 5 *.gradle files (91 lines of code)
    • 3 *.cpp files (69 lines of code)
    • 2 *.h files (35 lines of code)
    • 1 *.properties files (14 lines of code)
  • " *.xml" is biggest, containing 25.23% of code.
  • " *.properties" is smallest, containing 0.73% of code.


*.xml486 LOC (25%) 33 files
*.java479 LOC (24%) 24 files
*.md406 LOC (21%) 7 files
*.txt209 LOC (10%) 4 files
*.json137 LOC (7%) 6 files
*.gradle91 LOC (4%) 5 files
*.cpp69 LOC (3%) 3 files
*.h35 LOC (1%) 2 files
*.properties14 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
  • *.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
  • *.proto 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
  • *.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
  • *.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
  • *.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
  • *.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)
  • *.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:07