facebook / kuduraft
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
adoc
cmake
proto
patch
xsl
in
cfg
tex
bib
clang-tidy
  • 28 extensions are included in analyses: cc, h, txt, sh, py, adoc, cmake, proto, patch, json, mustache, xml, md, js, r, gitignore, pl, css, java, c, xsl, html, in, erb, cfg, tex, bib, clang-tidy
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (65 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (1 file).
    • exclude files with path like ".*/d3(\.v\d+)?([^.]*)\.js" (D3) (1 file).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (47 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (2 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.

main151378 LOC (78%) 816 files
test32530 LOC (16%) 123 files
generated0 LOC (0%) 0 files
build and deployment1268 LOC (<1%) 17 files
other7890 LOC (4%) 63 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
cmake
adoc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 816 files match defined criteria (151,378 lines of code, 100.0% vs. main code):
    • 384 *.cc files (100,988 lines of code)
    • 334 *.h files (41,061 lines of code)
    • 24 *.proto files (2,994 lines of code)
    • 19 *.py files (2,808 lines of code)
    • 27 *.cmake files (1,425 lines of code)
    • 14 *.mustache files (830 lines of code)
    • 4 *.pl files (469 lines of code)
    • 3 *.c files (373 lines of code)
    • 2 *.adoc files (232 lines of code)
    • 1 *.js files (144 lines of code)
    • 1 *.css files (28 lines of code)
    • 2 *.html files (21 lines of code)
    • 1 *.xml files (5 lines of code)
  • " *.cc" is biggest, containing 66.71% of code.
  • " *.xml" is smallest, containing 0% of code.


*.cc100988 LOC (66%) 384 files
*.h41061 LOC (27%) 334 files
*.proto2994 LOC (1%) 24 files
*.py2808 LOC (1%) 19 files
*.cmake1425 LOC (<1%) 27 files
*.mustache830 LOC (<1%) 14 files
*.pl469 LOC (<1%) 4 files
*.c373 LOC (<1%) 3 files
*.adoc232 LOC (<1%) 2 files
*.js144 LOC (<1%) 1 files
*.css28 LOC (<1%) 1 files
*.html21 LOC (<1%) 2 files
*.xml5 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[-]tests/.*".
  • 123 files match defined criteria (32,530 lines of code, 21.5% vs. main code):
    • 84 *.cc files (28,138 lines of code)
    • 25 *.h files (3,360 lines of code)
    • 4 *.py files (810 lines of code)
    • 3 *.proto files (123 lines of code)
    • 1 *.sh files (77 lines of code)
    • 6 *.xml files (22 lines of code)
  • " *.cc" is biggest, containing 86.5% of code.
  • " *.xml" is smallest, containing 0.07% of code.


*.cc28138 LOC (86%) 84 files
*.h3360 LOC (10%) 25 files
*.py810 LOC (2%) 4 files
*.proto123 LOC (<1%) 3 files
*.sh77 LOC (<1%) 1 files
*.xml22 LOC (<1%) 6 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 ".*/pom[.]xml".
  • 17 files match defined criteria (1,268 lines of code, 0.8% vs. main code). All matches are in *.sh files.


*.sh1268 LOC (100%) 17 files
Other Code
txt
adoc
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]patch".
  • 63 files match defined criteria (7,890 lines of code, 5.2% vs. main code):
    • 39 *.txt files (5,851 lines of code)
    • 7 *.adoc files (706 lines of code)
    • 3 *.java files (407 lines of code)
    • 5 *.py files (339 lines of code)
    • 1 *.cc files (239 lines of code)
    • 3 *.xml files (165 lines of code)
    • 3 *.md files (109 lines of code)
    • 1 *.json files (72 lines of code)
    • 1 *.cfg files (2 lines of code)
  • " *.txt" is biggest, containing 74.16% of code.
  • " *.cfg" is smallest, containing 0.03% of code.


*.txt5851 LOC (74%) 39 files
*.adoc706 LOC (8%) 7 files
*.java407 LOC (5%) 3 files
*.py339 LOC (4%) 5 files
*.cc239 LOC (3%) 1 files
*.xml165 LOC (2%) 3 files
*.md109 LOC (1%) 3 files
*.json72 LOC (<1%) 1 files
*.cfg2 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
  • *.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
  • *.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
  • *.mustache files are analyzed with HtmlAnalyzer:
    • 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
  • *.pl files are analyzed with PerlAnalyzer:
    • 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
  • *.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
  • *.adoc 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
  • *.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
  • *.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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.xml files are analyzed with XmlAnalyzer:
    • 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


2022-04-15 00:40