facebook / openbmc-uboot
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
cfg
lds
mk
cocci
asn1
cmd
patch
in
sed
l
y
ini
glade
cxx
gpt
gitattributes
boot
gdb
mak
tpl
tcl
  • 37 extensions are included in analyses: h, c, txt, py, s, rst, cfg, lds, mk, gitignore, sh, inc, cocci, pl, asn1, cmd, patch, in, yml, css, sed, l, y, md, ini, glade, cc, svg, cxx, gpt, gitattributes, json, boot, gdb, mak, tpl, tcl
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (41 files).
    • exclude files with path like ".*/cache/.*" (Caches) (5 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (6 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.

main2168713 LOC (95%) 12349 files
test34980 LOC (1%) 288 files
generated0 LOC (0%) 0 files
build and deployment2648 LOC (<1%) 73 files
other58834 LOC (2%) 591 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cfg
lds
y
boot
cocci
l
glade
cmd
asn1
gdb
tcl
in
sed
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 12349 files match defined criteria (2,168,713 lines of code, 100.0% vs. main code):
    • 4,915 *.c files (1,306,279 lines of code)
    • 7,009 *.h files (813,050 lines of code)
    • 139 *.py files (21,207 lines of code)
    • 6 *.pl files (8,583 lines of code)
    • 184 *.cfg files (5,335 lines of code)
    • 53 *.lds files (3,956 lines of code)
    • 10 *.inc files (3,887 lines of code)
    • 1 *.cc files (1,577 lines of code)
    • 2 *.y files (1,171 lines of code)
    • 1 *.boot files (896 lines of code)
    • 9 *.cocci files (860 lines of code)
    • 2 *.l files (653 lines of code)
    • 1 *.glade files (603 lines of code)
    • 5 *.cmd files (205 lines of code)
    • 4 *.asn1 files (186 lines of code)
    • 1 *.gdb files (137 lines of code)
    • 1 *.css files (44 lines of code)
    • 1 *.tcl files (33 lines of code)
    • 3 *.in files (27 lines of code)
    • 2 *.sed files (24 lines of code)
  • " *.c" is biggest, containing 60.23% of code.
  • " *.sed" is smallest, containing 0% of code.


*.c1306279 LOC (60%) 4915 files
*.h813050 LOC (37%) 7009 files
*.py21207 LOC (<1%) 139 files
*.pl8583 LOC (<1%) 6 files
*.cfg5335 LOC (<1%) 184 files
*.lds3956 LOC (<1%) 53 files
*.inc3887 LOC (<1%) 10 files
*.cc1577 LOC (<1%) 1 files
*.y1171 LOC (<1%) 2 files
*.boot896 LOC (<1%) 1 files
*.cocci860 LOC (<1%) 9 files
*.l653 LOC (<1%) 2 files
*.glade603 LOC (<1%) 1 files
*.cmd205 LOC (<1%) 5 files
*.asn1186 LOC (<1%) 4 files
*.gdb137 LOC (<1%) 1 files
*.css44 LOC (<1%) 1 files
*.tcl33 LOC (<1%) 1 files
*.in27 LOC (<1%) 3 files
*.sed24 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
lds
cxx
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/tests_.*".
  • 288 files match defined criteria (34,980 lines of code, 1.6% vs. main code):
    • 160 *.c files (21,226 lines of code)
    • 98 *.py files (12,194 lines of code)
    • 7 *.sh files (949 lines of code)
    • 16 *.h files (431 lines of code)
    • 5 *.lds files (102 lines of code)
    • 1 *.css files (75 lines of code)
    • 1 *.cxx files (3 lines of code)
  • " *.c" is biggest, containing 60.68% of code.
  • " *.cxx" is smallest, containing 0.01% of code.


*.c21226 LOC (60%) 160 files
*.py12194 LOC (34%) 98 files
*.sh949 LOC (2%) 7 files
*.h431 LOC (1%) 16 files
*.lds102 LOC (<1%) 5 files
*.css75 LOC (<1%) 1 files
*.cxx3 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
mak
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 ".*[.]mak".
    • files with paths like ".*/[.]gitattributes".
  • 73 files match defined criteria (2,648 lines of code, 0.1% vs. main code):
    • 26 *.sh files (1,372 lines of code)
    • 46 *.mk files (1,239 lines of code)
    • 1 *.mak files (37 lines of code)
  • " *.sh" is biggest, containing 51.81% of code.
  • " *.mak" is smallest, containing 1.4% of code.


*.sh1372 LOC (51%) 26 files
*.mk1239 LOC (46%) 46 files
*.mak37 LOC (1%) 1 files
Other Code
txt
gpt
patch
lds
asn1
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[Ee]xamples/.*".
  • 591 files match defined criteria (58,834 lines of code, 2.7% vs. main code):
    • 341 *.txt files (28,449 lines of code)
    • 225 *.rst files (27,740 lines of code)
    • 12 *.c files (1,750 lines of code)
    • 1 *.gpt files (250 lines of code)
    • 1 *.svg files (239 lines of code)
    • 3 *.patch files (133 lines of code)
    • 1 *.json files (72 lines of code)
    • 2 *.lds files (70 lines of code)
    • 1 *.md files (50 lines of code)
    • 1 *.h files (32 lines of code)
    • 1 *.asn1 files (32 lines of code)
    • 2 *.ini files (17 lines of code)
  • " *.txt" is biggest, containing 48.35% of code.
  • " *.ini" is smallest, containing 0.03% of code.


*.txt28449 LOC (48%) 341 files
*.rst27740 LOC (47%) 225 files
*.c1750 LOC (2%) 12 files
*.gpt250 LOC (<1%) 1 files
*.svg239 LOC (<1%) 1 files
*.patch133 LOC (<1%) 3 files
*.json72 LOC (<1%) 1 files
*.lds70 LOC (<1%) 2 files
*.md50 LOC (<1%) 1 files
*.h32 LOC (<1%) 1 files
*.asn132 LOC (<1%) 1 files
*.ini17 LOC (<1%) 2 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.inc 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.gdb 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
  • *.tcl 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
  • *.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:44