facebook / wangle
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
cmake
txt
in
clang-tidy
  • 13 extensions are included in analyses: h, cpp, py, cmake, md, yml, txt, sh, gitignore, c, in, json, clang-tidy
  • 2 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 ".*/deps/.*" (Dependencies) (2 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.

main21817 LOC (70%) 195 files
test8045 LOC (26%) 67 files
generated0 LOC (0%) 0 files
build and deployment189 LOC (<1%) 3 files
other796 LOC (2%) 9 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 ".*".
  • 195 files match defined criteria (21,817 lines of code, 100.0% vs. main code):
    • 95 *.h files (7,153 lines of code)
    • 29 *.py files (6,646 lines of code)
    • 46 *.cpp files (5,681 lines of code)
    • 23 *.cmake files (2,254 lines of code)
    • 1 *.c files (74 lines of code)
    • 1 *.in files (9 lines of code)
  • " *.h" is biggest, containing 32.79% of code.
  • " *.in" is smallest, containing 0.04% of code.


*.h7153 LOC (32%) 95 files
*.py6646 LOC (30%) 29 files
*.cpp5681 LOC (26%) 46 files
*.cmake2254 LOC (10%) 23 files
*.c74 LOC (<1%) 1 files
*.in9 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/.*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*_test[.].*".
  • 67 files match defined criteria (8,045 lines of code, 36.9% vs. main code):
    • 36 *.cpp files (6,905 lines of code)
    • 12 *.h files (638 lines of code)
    • 19 *.py files (502 lines of code)
  • " *.cpp" is biggest, containing 85.83% of code.
  • " *.py" is smallest, containing 6.24% of code.


*.cpp6905 LOC (85%) 36 files
*.h638 LOC (7%) 12 files
*.py502 LOC (6%) 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 3 files match defined criteria (189 lines of code, 0.9% vs. main code). All matches are in *.sh files.


*.sh189 LOC (100%) 3 files
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
  • 9 files match defined criteria (796 lines of code, 3.6% vs. main code):
    • 7 *.md files (439 lines of code)
    • 1 *.txt files (285 lines of code)
    • 1 *.json files (72 lines of code)
  • " *.md" is biggest, containing 55.15% of code.
  • " *.json" is smallest, containing 9.05% of code.


*.md439 LOC (55%) 7 files
*.txt285 LOC (35%) 1 files
*.json72 LOC (9%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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:57