facebook / zstd
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
cmd
vcxproj
cmake
mk
in
inl
lua
gitattributes
cfg
props
s
  • 25 extensions are included in analyses: c, h, sh, md, gitignore, cpp, py, txt, cmd, vcxproj, yml, cmake, html, mk, in, inl, lua, gitattributes, bat, json, yaml, swift, cfg, props, s
  • 1 criterion is used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (32 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.

main68249 LOC (65%) 188 files
test22784 LOC (22%) 134 files
generated0 LOC (0%) 0 files
build and deployment491 LOC (<1%) 10 files
other12020 LOC (11%) 71 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
cmake
cmd
lua
in
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 188 files match defined criteria (68,249 lines of code, 100.0% vs. main code):
    • 66 *.c files (51,953 lines of code)
    • 83 *.h files (10,531 lines of code)
    • 8 *.vcxproj files (1,731 lines of code)
    • 1 *.html files (1,665 lines of code)
    • 5 *.cpp files (1,042 lines of code)
    • 4 *.py files (773 lines of code)
    • 1 *.yml files (186 lines of code)
    • 4 *.cmake files (126 lines of code)
    • 9 *.cmd files (94 lines of code)
    • 2 *.lua files (69 lines of code)
    • 2 *.in files (34 lines of code)
    • 1 *.swift files (27 lines of code)
    • 1 *.yaml files (10 lines of code)
    • 1 *.props files (8 lines of code)
  • " *.c" is biggest, containing 76.12% of code.
  • " *.props" is smallest, containing 0.01% of code.


*.c51953 LOC (76%) 66 files
*.h10531 LOC (15%) 83 files
*.vcxproj1731 LOC (2%) 8 files
*.html1665 LOC (2%) 1 files
*.cpp1042 LOC (1%) 5 files
*.py773 LOC (1%) 4 files
*.yml186 LOC (<1%) 1 files
*.cmake126 LOC (<1%) 4 files
*.cmd94 LOC (<1%) 9 files
*.lua69 LOC (<1%) 2 files
*.in34 LOC (<1%) 2 files
*.swift27 LOC (<1%) 1 files
*.yaml10 LOC (<1%) 1 files
*.props8 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cfg
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 ".*[-]tests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
  • 134 files match defined criteria (22,784 lines of code, 33.4% vs. main code):
    • 45 *.c files (15,461 lines of code)
    • 48 *.sh files (2,934 lines of code)
    • 8 *.py files (2,224 lines of code)
    • 9 *.cpp files (1,191 lines of code)
    • 23 *.h files (973 lines of code)
    • 1 *.cfg files (1 lines of code)
  • " *.c" is biggest, containing 67.86% of code.
  • " *.cfg" is smallest, containing 0% of code.


*.c15461 LOC (67%) 45 files
*.sh2934 LOC (12%) 48 files
*.py2224 LOC (9%) 8 files
*.cpp1191 LOC (5%) 9 files
*.h973 LOC (4%) 23 files
*.cfg1 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]mk".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]bat".
  • 10 files match defined criteria (491 lines of code, 0.7% vs. main code):
    • 7 *.sh files (251 lines of code)
    • 2 *.mk files (220 lines of code)
    • 1 *.bat files (20 lines of code)
  • " *.sh" is biggest, containing 51.12% of code.
  • " *.bat" is smallest, containing 4.07% of code.


*.sh251 LOC (51%) 7 files
*.mk220 LOC (44%) 2 files
*.bat20 LOC (4%) 1 files
Other Code
inl
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
  • 71 files match defined criteria (12,020 lines of code, 17.6% vs. main code):
    • 34 *.md files (4,100 lines of code)
    • 24 *.c files (4,050 lines of code)
    • 2 *.inl files (2,992 lines of code)
    • 8 *.txt files (655 lines of code)
    • 1 *.h files (121 lines of code)
    • 1 *.json files (72 lines of code)
    • 1 *.html files (30 lines of code)
  • " *.md" is biggest, containing 34.11% of code.
  • " *.html" is smallest, containing 0.25% of code.


*.md4100 LOC (34%) 34 files
*.c4050 LOC (33%) 24 files
*.inl2992 LOC (24%) 2 files
*.txt655 LOC (5%) 8 files
*.h121 LOC (1%) 1 files
*.json72 LOC (<1%) 1 files
*.html30 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.vcxproj 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
  • *.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
  • *.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
  • *.yml files are analyzed with YamlAnalyzer:
    • 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
  • *.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
  • *.cmd 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
  • *.lua files are analyzed with LuaAnalyzer:
    • 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
  • *.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
  • *.swift files are analyzed with SwiftAnalyzer:
    • 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
  • *.yaml files are analyzed with YamlAnalyzer:
    • 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
  • *.props 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-14 22:59