facebookincubator / mvfst
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
prettierignore
  • 20 extensions are included in analyses: cpp, h, py, txt, cmake, md, rs, js, sh, svg, gitignore, yml, json, css, c, in, clang-format, toml, clang-tidy, prettierignore
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (13 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (15 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (0 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.

main52248 LOC (44%) 328 files
test62141 LOC (52%) 138 files
generated0 LOC (0%) 0 files
build and deployment564 LOC (<1%) 6 files
other3272 LOC (2%) 50 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 ".*".
  • 328 files match defined criteria (52,248 lines of code, 100.0% vs. main code):
    • 113 *.cpp files (28,816 lines of code)
    • 156 *.h files (14,029 lines of code)
    • 29 *.py files (6,645 lines of code)
    • 28 *.cmake files (2,657 lines of code)
    • 1 *.c files (74 lines of code)
    • 1 *.in files (27 lines of code)
  • " *.cpp" is biggest, containing 55.15% of code.
  • " *.in" is smallest, containing 0.05% of code.


*.cpp28816 LOC (55%) 113 files
*.h14029 LOC (26%) 156 files
*.py6645 LOC (12%) 29 files
*.cmake2657 LOC (5%) 28 files
*.c74 LOC (<1%) 1 files
*.in27 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 ".*/[Ss]pecs/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
  • 138 files match defined criteria (62,141 lines of code, 118.9% vs. main code):
    • 94 *.cpp files (57,705 lines of code)
    • 25 *.h files (3,934 lines of code)
    • 19 *.py files (502 lines of code)
  • " *.cpp" is biggest, containing 92.86% of code.
  • " *.py" is smallest, containing 0.81% of code.


*.cpp57705 LOC (92%) 94 files
*.h3934 LOC (6%) 25 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".
    • files with paths like ".*/package[.]json".
  • 6 files match defined criteria (564 lines of code, 1.1% vs. main code). All matches are in *.sh files.


*.sh564 LOC (100%) 6 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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 50 files match defined criteria (3,272 lines of code, 6.3% vs. main code):
    • 40 *.txt files (2,430 lines of code)
    • 4 *.h files (500 lines of code)
    • 4 *.md files (232 lines of code)
    • 1 *.json files (72 lines of code)
    • 1 *.cpp files (38 lines of code)
  • " *.txt" is biggest, containing 74.27% of code.
  • " *.cpp" is smallest, containing 1.16% of code.


*.txt2430 LOC (74%) 40 files
*.h500 LOC (15%) 4 files
*.md232 LOC (7%) 4 files
*.json72 LOC (2%) 1 files
*.cpp38 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-15 01:23