facebook / openr
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
clang-format
prettierignore
  • 16 extensions are included in analyses: cpp, py, h, md, cmake, thrift, sh, txt, json, rst, yml, gitignore, c, clang-format, bat, prettierignore
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (10 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (4 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (37 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.

main47412 LOC (54%) 231 files
test38365 LOC (43%) 109 files
generated0 LOC (0%) 0 files
build and deployment310 LOC (<1%) 8 files
other1475 LOC (1%) 18 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 231 files match defined criteria (47,412 lines of code, 100.0% vs. main code):
    • 56 *.cpp files (22,423 lines of code)
    • 71 *.py files (13,221 lines of code)
    • 71 *.h files (7,624 lines of code)
    • 22 *.cmake files (2,455 lines of code)
    • 10 *.thrift files (1,615 lines of code)
    • 1 *.c files (74 lines of code)
  • " *.cpp" is biggest, containing 47.29% of code.
  • " *.c" is smallest, containing 0.16% of code.


*.cpp22423 LOC (47%) 56 files
*.py13221 LOC (27%) 71 files
*.h7624 LOC (16%) 71 files
*.cmake2455 LOC (5%) 22 files
*.thrift1615 LOC (3%) 10 files
*.c74 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[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_tests[.].*".
  • 109 files match defined criteria (38,365 lines of code, 80.9% vs. main code):
    • 64 *.cpp files (36,045 lines of code)
    • 35 *.py files (1,525 lines of code)
    • 10 *.h files (795 lines of code)
  • " *.cpp" is biggest, containing 93.95% of code.
  • " *.h" is smallest, containing 2.07% of code.


*.cpp36045 LOC (93%) 64 files
*.py1525 LOC (3%) 35 files
*.h795 LOC (2%) 10 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 ".*[.]bat".
  • 8 files match defined criteria (310 lines of code, 0.7% vs. main code). All matches are in *.sh files.


*.sh310 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 ".*/[.]prettierignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
  • 18 files match defined criteria (1,475 lines of code, 3.1% vs. main code):
    • 1 *.txt files (702 lines of code)
    • 4 *.json files (296 lines of code)
    • 7 *.md files (268 lines of code)
    • 4 *.cpp files (173 lines of code)
    • 2 *.h files (36 lines of code)
  • " *.txt" is biggest, containing 47.59% of code.
  • " *.h" is smallest, containing 2.44% of code.


*.txt702 LOC (47%) 1 files
*.json296 LOC (20%) 4 files
*.md268 LOC (18%) 7 files
*.cpp173 LOC (11%) 4 files
*.h36 LOC (2%) 2 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
  • *.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
  • *.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
  • *.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
  • *.thrift files are analyzed with ThriftAnalyzer:
    • 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
  • *.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


2022-04-14 23:20