facebook / openbmc-linux
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
s
cocci
boot
xsl
lds
cfg
asn1
y
l
awk
in
uc
po
mk
ld
reg
inl
vim
profile
glade
sed
feature
mak
clang-format
gitattributes
ini
xs
  • 44 extensions are included in analyses: c, h, txt, rst, s, yaml, sh, json, gitignore, py, cocci, svg, pl, boot, xsl, lds, cfg, asn1, y, l, awk, cpp, in, uc, po, asm, mk, pm, ld, reg, inl, css, vim, profile, rb, glade, sed, feature, mak, cc, clang-format, gitattributes, ini, xs
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/target/.*" (Compiled files) (103 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (252 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (19 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.

main16884668 LOC (94%) 48622 files
test116677 LOC (<1%) 557 files
generated1 LOC (<1%) 1 files
build and deployment42210 LOC (<1%) 372 files
other880054 LOC (4%) 7221 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
reg
cocci
y
po
l
awk
glade
uc
asn1
lds
in
cfg
boot
ld
profile
inl
xs
sed
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 48622 files match defined criteria (16,884,668 lines of code, 100.0% vs. main code):
    • 27,612 *.c files (13,667,045 lines of code)
    • 20,683 *.h files (3,138,349 lines of code)
    • 43 *.pl files (28,051 lines of code)
    • 79 *.py files (20,705 lines of code)
    • 2 *.reg files (5,613 lines of code)
    • 59 *.cocci files (5,185 lines of code)
    • 9 *.y files (5,167 lines of code)
    • 5 *.po files (3,995 lines of code)
    • 8 *.l files (2,313 lines of code)
    • 3 *.asm files (2,213 lines of code)
    • 1 *.cc files (1,596 lines of code)
    • 6 *.awk files (1,149 lines of code)
    • 1 *.glade files (603 lines of code)
    • 5 *.uc files (446 lines of code)
    • 11 *.asn1 files (376 lines of code)
    • 15 *.lds files (365 lines of code)
    • 6 *.in files (322 lines of code)
    • 14 *.cfg files (304 lines of code)
    • 6 *.cpp files (278 lines of code)
    • 3 *.pm files (190 lines of code)
    • 44 *.boot files (130 lines of code)
    • 2 *.ld files (104 lines of code)
    • 1 *.profile files (69 lines of code)
    • 2 *.inl files (59 lines of code)
    • 1 *.xs files (36 lines of code)
    • 1 *.sed files (5 lines of code)
  • " *.c" is biggest, containing 80.94% of code.
  • " *.sed" is smallest, containing 0% of code.


*.c13667045 LOC (80%) 27612 files
*.h3138349 LOC (18%) 20683 files
*.pl28051 LOC (<1%) 43 files
*.py20705 LOC (<1%) 79 files
*.reg5613 LOC (<1%) 2 files
*.cocci5185 LOC (<1%) 59 files
*.y5167 LOC (<1%) 9 files
*.po3995 LOC (<1%) 5 files
*.l2313 LOC (<1%) 8 files
*.asm2213 LOC (<1%) 3 files
*.cc1596 LOC (<1%) 1 files
*.awk1149 LOC (<1%) 6 files
*.glade603 LOC (<1%) 1 files
*.uc446 LOC (<1%) 5 files
*.asn1376 LOC (<1%) 11 files
*.lds365 LOC (<1%) 15 files
*.in322 LOC (<1%) 6 files
*.cfg304 LOC (<1%) 14 files
*.cpp278 LOC (<1%) 6 files
*.pm190 LOC (<1%) 3 files
*.boot130 LOC (<1%) 44 files
*.ld104 LOC (<1%) 2 files
*.profile69 LOC (<1%) 1 files
*.inl59 LOC (<1%) 2 files
*.xs36 LOC (<1%) 1 files
*.sed5 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cocci
feature
awk
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 ".*[-]tests/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.]feature".
  • 557 files match defined criteria (116,677 lines of code, 0.7% vs. main code):
    • 424 *.c files (105,277 lines of code)
    • 69 *.sh files (5,533 lines of code)
    • 39 *.h files (3,339 lines of code)
    • 18 *.py files (1,963 lines of code)
    • 4 *.cocci files (262 lines of code)
    • 1 *.feature files (224 lines of code)
    • 1 *.awk files (63 lines of code)
    • 1 *.cpp files (16 lines of code)
  • " *.c" is biggest, containing 90.23% of code.
  • " *.cpp" is smallest, containing 0.01% of code.


*.c105277 LOC (90%) 424 files
*.sh5533 LOC (4%) 69 files
*.h3339 LOC (2%) 39 files
*.py1963 LOC (1%) 18 files
*.cocci262 LOC (<1%) 4 files
*.feature224 LOC (<1%) 1 files
*.awk63 LOC (<1%) 1 files
*.cpp16 LOC (<1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/generated/.*".
  • 1 file matches defined criteria (1 lines of code, 0.0% vs. main code). All matches are in *.h files.


*.h1 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mak
mk
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 ".*[.]mk".
    • files with paths like ".*[.]mak".
    • files with paths like ".*/[.]gitattributes".
  • 372 files match defined criteria (42,210 lines of code, 0.2% vs. main code):
    • 368 *.sh files (41,882 lines of code)
    • 1 *.mak files (164 lines of code)
    • 3 *.mk files (164 lines of code)
  • " *.sh" is biggest, containing 99.22% of code.
  • " *.mk" is smallest, containing 0.39% of code.


*.sh41882 LOC (99%) 368 files
*.mak164 LOC (<1%) 1 files
*.mk164 LOC (<1%) 3 files
Other Code
txt
xsl
awk
vim
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]vim".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]ini".
  • 7221 files match defined criteria (880,054 lines of code, 5.2% vs. main code):
    • 2,237 *.rst files (343,433 lines of code)
    • 3,856 *.txt files (264,665 lines of code)
    • 307 *.json files (162,793 lines of code)
    • 55 *.svg files (38,586 lines of code)
    • 511 *.yaml files (36,862 lines of code)
    • 173 *.c files (26,400 lines of code)
    • 31 *.sh files (3,246 lines of code)
    • 13 *.py files (1,413 lines of code)
    • 4 *.pl files (1,231 lines of code)
    • 14 *.h files (955 lines of code)
    • 15 *.xsl files (183 lines of code)
    • 1 *.awk files (137 lines of code)
    • 1 *.css files (80 lines of code)
    • 1 *.vim files (39 lines of code)
    • 1 *.rb files (25 lines of code)
    • 1 *.ini files (6 lines of code)
  • " *.rst" is biggest, containing 39.02% of code.
  • " *.ini" is smallest, containing 0% of code.


*.rst343433 LOC (39%) 2237 files
*.txt264665 LOC (30%) 3856 files
*.json162793 LOC (18%) 307 files
*.svg38586 LOC (4%) 55 files
*.yaml36862 LOC (4%) 511 files
*.c26400 LOC (2%) 173 files
*.sh3246 LOC (<1%) 31 files
*.py1413 LOC (<1%) 13 files
*.pl1231 LOC (<1%) 4 files
*.h955 LOC (<1%) 14 files
*.xsl183 LOC (<1%) 15 files
*.awk137 LOC (<1%) 1 files
*.css80 LOC (<1%) 1 files
*.vim39 LOC (<1%) 1 files
*.rb25 LOC (<1%) 1 files
*.ini6 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
  • *.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
  • *.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
  • *.reg 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
  • *.cocci 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
  • *.y 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
  • *.po 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
  • *.l 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
  • *.asm 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
  • *.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
  • *.awk 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
  • *.glade 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
  • *.uc 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)
  • *.asn1 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
  • *.lds 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
  • *.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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.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
  • *.pm 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
  • *.boot files are analyzed with ClojureLangAnalyzer:
    • 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
  • *.ld 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
  • *.profile 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
  • *.inl 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
  • *.xs 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
  • *.sed 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


2022-04-15 00:35