facebook / rocksdb
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
ini
mk
in
watchmanconfig
clang-format
s
proto
  • 27 extensions are included in analyses: cc, h, java, markdown, html, sh, py, md, scss, yml, txt, cmake, ini, cpp, svg, gitignore, ps1, json, mk, c, xml, in, watchmanconfig, inc, clang-format, s, proto
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/cache/.*" (Caches) (23 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (144 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (45 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.

main264983 LOC (58%) 1154 files
test168159 LOC (37%) 332 files
generated0 LOC (0%) 0 files
build and deployment3486 LOC (<1%) 40 files
other12719 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
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1154 files match defined criteria (264,983 lines of code, 100.0% vs. main code):
    • 425 *.cc files (171,380 lines of code)
    • 494 *.h files (68,637 lines of code)
    • 194 *.java files (18,821 lines of code)
    • 26 *.py files (5,589 lines of code)
    • 10 *.cmake files (209 lines of code)
    • 1 *.inc files (168 lines of code)
    • 2 *.in files (93 lines of code)
    • 1 *.c files (63 lines of code)
    • 1 *.proto files (23 lines of code)
  • " *.cc" is biggest, containing 64.68% of code.
  • " *.proto" is smallest, containing 0.01% of code.


*.cc171380 LOC (64%) 425 files
*.h68637 LOC (25%) 494 files
*.java18821 LOC (7%) 194 files
*.py5589 LOC (2%) 26 files
*.cmake209 LOC (<1%) 10 files
*.inc168 LOC (<1%) 1 files
*.in93 LOC (<1%) 2 files
*.c63 LOC (<1%) 1 files
*.proto23 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
mk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
  • 332 files match defined criteria (168,159 lines of code, 63.5% vs. main code):
    • 198 *.cc files (142,343 lines of code)
    • 106 *.java files (18,162 lines of code)
    • 1 *.c files (2,396 lines of code)
    • 11 *.h files (2,029 lines of code)
    • 8 *.py files (1,928 lines of code)
    • 6 *.sh files (824 lines of code)
    • 1 *.ps1 files (407 lines of code)
    • 1 *.mk files (70 lines of code)
  • " *.cc" is biggest, containing 84.65% of code.
  • " *.mk" is smallest, containing 0.04% of code.


*.cc142343 LOC (84%) 198 files
*.java18162 LOC (10%) 106 files
*.c2396 LOC (1%) 1 files
*.h2029 LOC (1%) 11 files
*.py1928 LOC (1%) 8 files
*.sh824 LOC (<1%) 6 files
*.ps1407 LOC (<1%) 1 files
*.mk70 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]mk".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 40 files match defined criteria (3,486 lines of code, 1.3% vs. main code):
    • 37 *.sh files (2,699 lines of code)
    • 2 *.mk files (668 lines of code)
    • 1 *.xml files (119 lines of code)
  • " *.sh" is biggest, containing 77.42% of code.
  • " *.xml" is smallest, containing 3.41% of code.


*.sh2699 LOC (77%) 37 files
*.mk668 LOC (19%) 2 files
*.xml119 LOC (3%) 1 files
Other Code
txt
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/INSTALL[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]markdown".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Ee]xamples/.*".
  • 50 files match defined criteria (12,719 lines of code, 4.8% vs. main code):
    • 3 *.json files (7,901 lines of code)
    • 7 *.txt files (1,982 lines of code)
    • 8 *.cc files (982 lines of code)
    • 19 *.md files (823 lines of code)
    • 8 *.ini files (490 lines of code)
    • 4 *.java files (474 lines of code)
    • 1 *.c files (67 lines of code)
  • " *.json" is biggest, containing 62.12% of code.
  • " *.c" is smallest, containing 0.53% of code.


*.json7901 LOC (62%) 3 files
*.txt1982 LOC (15%) 7 files
*.cc982 LOC (7%) 8 files
*.md823 LOC (6%) 19 files
*.ini490 LOC (3%) 8 files
*.java474 LOC (3%) 4 files
*.c67 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.cc 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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.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
  • *.inc files are analyzed with PhpAnalyzer:
    • 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
  • *.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
  • *.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
  • *.proto 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


2022-04-14 22:43