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

main11979 LOC (71%) 87 files
test3004 LOC (17%) 34 files
generated0 LOC (0%) 0 files
build and deployment455 LOC (2%) 4 files
other1317 LOC (7%) 19 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 ".*".
  • 87 files match defined criteria (11,979 lines of code, 100.0% vs. main code):
    • 30 *.py files (6,658 lines of code)
    • 20 *.cmake files (2,111 lines of code)
    • 15 *.cpp files (1,858 lines of code)
    • 19 *.h files (1,198 lines of code)
    • 1 *.c files (74 lines of code)
    • 1 *.thrift files (65 lines of code)
    • 1 *.in files (15 lines of code)
  • " *.py" is biggest, containing 55.58% of code.
  • " *.in" is smallest, containing 0.13% of code.


*.py6658 LOC (55%) 30 files
*.cmake2111 LOC (17%) 20 files
*.cpp1858 LOC (15%) 15 files
*.h1198 LOC (10%) 19 files
*.c74 LOC (<1%) 1 files
*.thrift65 LOC (<1%) 1 files
*.in15 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]ests/.*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
  • 34 files match defined criteria (3,004 lines of code, 25.1% vs. main code):
    • 14 *.cpp files (2,492 lines of code)
    • 19 *.py files (502 lines of code)
    • 1 *.thrift files (10 lines of code)
  • " *.cpp" is biggest, containing 82.96% of code.
  • " *.thrift" is smallest, containing 0.33% of code.


*.cpp2492 LOC (82%) 14 files
*.py502 LOC (16%) 19 files
*.thrift10 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 4 files match defined criteria (455 lines of code, 3.8% vs. main code). All matches are in *.sh files.


*.sh455 LOC (100%) 4 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 ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
  • 19 files match defined criteria (1,317 lines of code, 11.0% vs. main code):
    • 5 *.cpp files (463 lines of code)
    • 2 *.txt files (369 lines of code)
    • 7 *.md files (306 lines of code)
    • 3 *.h files (90 lines of code)
    • 1 *.json files (72 lines of code)
    • 1 *.thrift files (17 lines of code)
  • " *.cpp" is biggest, containing 35.16% of code.
  • " *.thrift" is smallest, containing 1.29% of code.


*.cpp463 LOC (35%) 5 files
*.txt369 LOC (28%) 2 files
*.md306 LOC (23%) 7 files
*.h90 LOC (6%) 3 files
*.json72 LOC (5%) 1 files
*.thrift17 LOC (1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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:09