facebookincubator / velox
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
proto
orc
gitattributes
clang-format
gitmodules
  • 20 extensions are included in analyses: cpp, h, txt, py, rst, cmake, sh, md, proto, hpp, json, yml, orc, gitattributes, svg, gitignore, clang-format, bat, c, gitmodules
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (11 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (42 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (41 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (1 file).
    • exclude files with path like ".*/deps/.*" (Dependencies) (1 file).
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (1 file).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (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.

main139848 LOC (58%) 855 files
test90009 LOC (37%) 389 files
generated0 LOC (0%) 0 files
build and deployment582 LOC (<1%) 11 files
other7391 LOC (3%) 157 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 855 files match defined criteria (139,848 lines of code, 100.0% vs. main code):
    • 351 *.cpp files (71,303 lines of code)
    • 435 *.h files (57,071 lines of code)
    • 36 *.py files (7,442 lines of code)
    • 22 *.cmake files (2,431 lines of code)
    • 10 *.proto files (1,527 lines of code)
    • 1 *.c files (74 lines of code)
  • " *.cpp" is biggest, containing 50.99% of code.
  • " *.c" is smallest, containing 0.05% of code.


*.cpp71303 LOC (50%) 351 files
*.h57071 LOC (40%) 435 files
*.py7442 LOC (5%) 36 files
*.cmake2431 LOC (1%) 22 files
*.proto1527 LOC (1%) 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 ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Ss]pecs/.*".
  • 389 files match defined criteria (90,009 lines of code, 64.4% vs. main code):
    • 320 *.cpp files (84,069 lines of code)
    • 38 *.h files (4,953 lines of code)
    • 23 *.py files (614 lines of code)
    • 8 *.sh files (373 lines of code)
  • " *.cpp" is biggest, containing 93.4% of code.
  • " *.sh" is smallest, containing 0.41% of code.


*.cpp84069 LOC (93%) 320 files
*.h4953 LOC (5%) 38 files
*.py614 LOC (<1%) 23 files
*.sh373 LOC (<1%) 8 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 ".*/[.]gitmodules".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/[.]gitignore".
  • 11 files match defined criteria (582 lines of code, 0.4% vs. main code). All matches are in *.sh files.


*.sh582 LOC (100%) 11 files
Other Code
txt
orc
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 ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
  • 157 files match defined criteria (7,391 lines of code, 5.3% vs. main code):
    • 141 *.txt files (5,234 lines of code)
    • 3 *.json files (899 lines of code)
    • 9 *.md files (765 lines of code)
    • 3 *.cpp files (462 lines of code)
    • 1 *.orc files (31 lines of code)
  • " *.txt" is biggest, containing 70.82% of code.
  • " *.orc" is smallest, containing 0.42% of code.


*.txt5234 LOC (70%) 141 files
*.json899 LOC (12%) 3 files
*.md765 LOC (10%) 9 files
*.cpp462 LOC (6%) 3 files
*.orc31 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
  • *.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
  • *.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-15 05:08