facebook / proxygen
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
in
clang-format
clang-tidy
  • 14 extensions are included in analyses: h, cpp, py, txt, cmake, sh, md, yml, c, in, gitignore, clang-format, json, clang-tidy
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (6 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (4 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.

main55077 LOC (54%) 417 files
test38529 LOC (38%) 139 files
generated0 LOC (0%) 0 files
build and deployment711 LOC (<1%) 8 files
other6303 LOC (6%) 79 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 417 files match defined criteria (55,077 lines of code, 100.0% vs. main code):
    • 142 *.cpp files (27,086 lines of code)
    • 219 *.h files (18,800 lines of code)
    • 30 *.py files (6,813 lines of code)
    • 23 *.cmake files (2,254 lines of code)
    • 1 *.c files (74 lines of code)
    • 2 *.in files (50 lines of code)
  • " *.cpp" is biggest, containing 49.18% of code.
  • " *.in" is smallest, containing 0.09% of code.


*.cpp27086 LOC (49%) 142 files
*.h18800 LOC (34%) 219 files
*.py6813 LOC (12%) 30 files
*.cmake2254 LOC (4%) 23 files
*.c74 LOC (<1%) 1 files
*.in50 LOC (<1%) 2 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 ".*/[Tt]est/.*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*_test[.].*".
  • 139 files match defined criteria (38,529 lines of code, 70.0% vs. main code):
    • 91 *.cpp files (32,885 lines of code)
    • 29 *.h files (5,142 lines of code)
    • 19 *.py files (502 lines of code)
  • " *.cpp" is biggest, containing 85.35% of code.
  • " *.py" is smallest, containing 1.3% of code.


*.cpp32885 LOC (85%) 91 files
*.h5142 LOC (13%) 29 files
*.py502 LOC (1%) 19 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 8 files match defined criteria (711 lines of code, 1.3% vs. main code). All matches are in *.sh files.


*.sh711 LOC (100%) 8 files
Other Code
txt
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 ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
  • 79 files match defined criteria (6,303 lines of code, 11.4% vs. main code):
    • 23 *.cpp files (3,073 lines of code)
    • 30 *.txt files (1,517 lines of code)
    • 20 *.h files (1,378 lines of code)
    • 5 *.md files (263 lines of code)
    • 1 *.json files (72 lines of code)
  • " *.cpp" is biggest, containing 48.75% of code.
  • " *.json" is smallest, containing 1.14% of code.


*.cpp3073 LOC (48%) 23 files
*.txt1517 LOC (24%) 30 files
*.h1378 LOC (21%) 20 files
*.md263 LOC (4%) 5 files
*.json72 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
  • *.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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.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 22:56