facebook / openbmc-qemu
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
s
mak
txt
cocci
cfg
ld
po
hx
in
vert
gdbinit
ini
lds
pub
editorconfig
nsi
plist
lid
el
wxs
gitmodules
frag
gitattributes
desktop
inl
  • 44 extensions are included in analyses: c, h, json, py, rst, s, mak, inc, txt, sh, xml, yml, cocci, cfg, pl, ld, po, cc, hx, md, cpp, in, gitignore, vert, svg, gdbinit, ini, lds, pub, css, editorconfig, nsi, js, plist, m, lid, html, el, wxs, gitmodules, frag, gitattributes, desktop, inl
  • 4 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 ".*/target/.*" (Compiled files) (601 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (273 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 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.

main1068297 LOC (84%) 4052 files
test167220 LOC (13%) 1231 files
generated0 LOC (0%) 0 files
build and deployment2460 LOC (<1%) 132 files
other31353 LOC (2%) 270 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
hx
cocci
po
nsi
wxs
cfg
lds
inl
vert
in
desktop
frag
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 4052 files match defined criteria (1,068,297 lines of code, 100.0% vs. main code):
    • 1,948 *.c files (851,670 lines of code)
    • 1,855 *.h files (154,460 lines of code)
    • 27 *.inc files (23,536 lines of code)
    • 115 *.py files (15,914 lines of code)
    • 5 *.hx files (6,802 lines of code)
    • 9 *.pl files (4,801 lines of code)
    • 6 *.cc files (4,525 lines of code)
    • 1 *.m files (1,514 lines of code)
    • 36 *.xml files (1,384 lines of code)
    • 3 *.cpp files (1,275 lines of code)
    • 22 *.cocci files (1,116 lines of code)
    • 8 *.po files (449 lines of code)
    • 3 *.yml files (233 lines of code)
    • 1 *.nsi files (202 lines of code)
    • 1 *.wxs files (180 lines of code)
    • 2 *.cfg files (128 lines of code)
    • 2 *.lds files (44 lines of code)
    • 1 *.inl files (22 lines of code)
    • 2 *.vert files (14 lines of code)
    • 3 *.in files (13 lines of code)
    • 1 *.desktop files (8 lines of code)
    • 1 *.frag files (7 lines of code)
  • " *.c" is biggest, containing 79.72% of code.
  • " *.frag" is smallest, containing 0% of code.


*.c851670 LOC (79%) 1948 files
*.h154460 LOC (14%) 1855 files
*.inc23536 LOC (2%) 27 files
*.py15914 LOC (1%) 115 files
*.hx6802 LOC (<1%) 5 files
*.pl4801 LOC (<1%) 9 files
*.cc4525 LOC (<1%) 6 files
*.m1514 LOC (<1%) 1 files
*.xml1384 LOC (<1%) 36 files
*.cpp1275 LOC (<1%) 3 files
*.cocci1116 LOC (<1%) 22 files
*.po449 LOC (<1%) 8 files
*.yml233 LOC (<1%) 3 files
*.nsi202 LOC (<1%) 1 files
*.wxs180 LOC (<1%) 1 files
*.cfg128 LOC (<1%) 2 files
*.lds44 LOC (<1%) 2 files
*.inl22 LOC (<1%) 1 files
*.vert14 LOC (<1%) 2 files
*.in13 LOC (<1%) 3 files
*.desktop8 LOC (<1%) 1 files
*.frag7 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
s
ld
pub
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Ss]pecs/.*".
  • 1231 files match defined criteria (167,220 lines of code, 15.7% vs. main code):
    • 942 *.c files (140,390 lines of code)
    • 90 *.py files (11,237 lines of code)
    • 84 *.h files (5,191 lines of code)
    • 31 *.sh files (4,989 lines of code)
    • 68 *.s files (4,426 lines of code)
    • 3 *.inc files (698 lines of code)
    • 8 *.ld files (242 lines of code)
    • 2 *.yml files (33 lines of code)
    • 1 *.xml files (12 lines of code)
    • 2 *.pub files (2 lines of code)
  • " *.c" is biggest, containing 83.96% of code.
  • " *.pub" is smallest, containing 0% of code.


*.c140390 LOC (83%) 942 files
*.py11237 LOC (6%) 90 files
*.h5191 LOC (3%) 84 files
*.sh4989 LOC (2%) 31 files
*.s4426 LOC (2%) 68 files
*.inc698 LOC (<1%) 3 files
*.ld242 LOC (<1%) 8 files
*.yml33 LOC (<1%) 2 files
*.xml12 LOC (<1%) 1 files
*.pub2 LOC (<1%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mak
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 ".*/[.]gitmodules".
    • files with paths like ".*[.]mak".
    • files with paths like ".*/[.]gitattributes".
  • 132 files match defined criteria (2,460 lines of code, 0.2% vs. main code):
    • 32 *.sh files (1,836 lines of code)
    • 100 *.mak files (624 lines of code)
  • " *.sh" is biggest, containing 74.63% of code.
  • " *.mak" is smallest, containing 25.37% of code.


*.sh1836 LOC (74%) 32 files
*.mak624 LOC (25%) 100 files
Other Code
txt
ini
plist
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]plist".
  • 270 files match defined criteria (31,353 lines of code, 2.9% vs. main code):
    • 250 *.json files (24,512 lines of code)
    • 7 *.txt files (6,216 lines of code)
    • 9 *.rst files (498 lines of code)
    • 1 *.md files (99 lines of code)
    • 2 *.ini files (20 lines of code)
    • 1 *.plist files (8 lines of code)
  • " *.json" is biggest, containing 78.18% of code.
  • " *.plist" is smallest, containing 0.03% of code.


*.json24512 LOC (78%) 250 files
*.txt6216 LOC (19%) 7 files
*.rst498 LOC (1%) 9 files
*.md99 LOC (<1%) 1 files
*.ini20 LOC (<1%) 2 files
*.plist8 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
  • *.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
  • *.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
  • *.hx 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
  • *.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
  • *.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
  • *.m 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.nsi 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
  • *.wxs 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
  • *.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
  • *.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
  • *.vert 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
  • *.desktop 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
  • *.frag 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


2022-04-15 00:49