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

main28736 LOC (73%) 328 files
test9602 LOC (24%) 89 files
generated0 LOC (0%) 0 files
build and deployment261 LOC (<1%) 6 files
other347 LOC (<1%) 6 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 ".*".
  • 328 files match defined criteria (28,736 lines of code, 100.0% vs. main code):
    • 82 *.cpp files (9,302 lines of code)
    • 36 *.py files (6,906 lines of code)
    • 70 *.php files (4,902 lines of code)
    • 96 *.h files (4,306 lines of code)
    • 21 *.cmake files (2,248 lines of code)
    • 13 *.css files (532 lines of code)
    • 5 *.thrift files (317 lines of code)
    • 4 *.js files (149 lines of code)
    • 1 *.c files (74 lines of code)
  • " *.cpp" is biggest, containing 32.37% of code.
  • " *.c" is smallest, containing 0.26% of code.


*.cpp9302 LOC (32%) 82 files
*.py6906 LOC (24%) 36 files
*.php4902 LOC (17%) 70 files
*.h4306 LOC (14%) 96 files
*.cmake2248 LOC (7%) 21 files
*.css532 LOC (1%) 13 files
*.thrift317 LOC (1%) 5 files
*.js149 LOC (<1%) 4 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]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Ss]pecs/.*".
  • 89 files match defined criteria (9,602 lines of code, 33.4% vs. main code):
    • 60 *.cpp files (8,684 lines of code)
    • 19 *.py files (502 lines of code)
    • 9 *.h files (379 lines of code)
    • 1 *.sh files (37 lines of code)
  • " *.cpp" is biggest, containing 90.44% of code.
  • " *.sh" is smallest, containing 0.39% of code.


*.cpp8684 LOC (90%) 60 files
*.py502 LOC (5%) 19 files
*.h379 LOC (3%) 9 files
*.sh37 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 6 files match defined criteria (261 lines of code, 0.9% vs. main code). All matches are in *.sh files.


*.sh261 LOC (100%) 6 files
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
  • 6 files match defined criteria (347 lines of code, 1.2% vs. main code):
    • 4 *.md files (266 lines of code)
    • 1 *.json files (72 lines of code)
    • 1 *.txt files (9 lines of code)
  • " *.md" is biggest, containing 76.66% of code.
  • " *.txt" is smallest, containing 2.59% of code.


*.md266 LOC (76%) 4 files
*.json72 LOC (20%) 1 files
*.txt9 LOC (2%) 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
  • *.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
  • *.php 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
  • *.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
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.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
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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


2022-04-14 22:53