facebookincubator / oculus-linux-kernel
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
boot
cocci
lds
tst
l
y
xsl
awk
in
po
uc
asn1
ld
cfg
gdbinit
reg
mk
inl
vim
tex
glade
sc
sed
xs
mak
rest
  • 43 extensions are included in analyses: c, h, txt, s, xml, gitignore, sh, boot, cocci, pl, py, lds, tst, l, y, xsl, awk, svg, in, inc, po, uc, asn1, ld, cfg, asm, gdbinit, pm, reg, html, mk, inl, vim, tex, glade, sc, sed, cc, json, xs, mak, mm, rest
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (134 files).
    • exclude files with path like ".*/target/.*" (Compiled files) (87 files).
    • exclude files with path like ".*/cache/.*" (Caches) (5 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (15 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.

main13409260 LOC (96%) 39678 files
test34606 LOC (<1%) 145 files
generated0 LOC (0%) 0 files
build and deployment3639 LOC (<1%) 71 files
other380776 LOC (2%) 3116 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
reg
y
po
cocci
l
tst
gdbinit
glade
awk
lds
cfg
uc
boot
asn1
ld
in
inl
xs
sed
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 39678 files match defined criteria (13,409,260 lines of code, 100.0% vs. main code):
    • 21,561 *.c files (11,029,992 lines of code)
    • 17,867 *.h files (2,333,320 lines of code)
    • 27 *.pl files (14,279 lines of code)
    • 2 *.reg files (5,613 lines of code)
    • 23 *.py files (5,220 lines of code)
    • 8 *.y files (4,660 lines of code)
    • 5 *.po files (3,979 lines of code)
    • 47 *.cocci files (3,493 lines of code)
    • 8 *.l files (2,027 lines of code)
    • 1 *.cc files (1,529 lines of code)
    • 13 *.tst files (1,140 lines of code)
    • 3 *.gdbinit files (618 lines of code)
    • 1 *.glade files (603 lines of code)
    • 5 *.awk files (592 lines of code)
    • 16 *.lds files (475 lines of code)
    • 3 *.cfg files (281 lines of code)
    • 5 *.inc files (236 lines of code)
    • 4 *.uc files (209 lines of code)
    • 3 *.pm files (190 lines of code)
    • 56 *.boot files (187 lines of code)
    • 4 *.asn1 files (178 lines of code)
    • 3 *.asm files (134 lines of code)
    • 4 *.ld files (105 lines of code)
    • 5 *.in files (104 lines of code)
    • 2 *.inl files (59 lines of code)
    • 1 *.xs files (36 lines of code)
    • 1 *.sed files (1 lines of code)
  • " *.c" is biggest, containing 82.26% of code.
  • " *.sed" is smallest, containing 0% of code.


*.c11029992 LOC (82%) 21561 files
*.h2333320 LOC (17%) 17867 files
*.pl14279 LOC (<1%) 27 files
*.reg5613 LOC (<1%) 2 files
*.py5220 LOC (<1%) 23 files
*.y4660 LOC (<1%) 8 files
*.po3979 LOC (<1%) 5 files
*.cocci3493 LOC (<1%) 47 files
*.l2027 LOC (<1%) 8 files
*.cc1529 LOC (<1%) 1 files
*.tst1140 LOC (<1%) 13 files
*.gdbinit618 LOC (<1%) 3 files
*.glade603 LOC (<1%) 1 files
*.awk592 LOC (<1%) 5 files
*.lds475 LOC (<1%) 16 files
*.cfg281 LOC (<1%) 3 files
*.inc236 LOC (<1%) 5 files
*.uc209 LOC (<1%) 4 files
*.pm190 LOC (<1%) 3 files
*.boot187 LOC (<1%) 56 files
*.asn1178 LOC (<1%) 4 files
*.asm134 LOC (<1%) 3 files
*.ld105 LOC (<1%) 4 files
*.in104 LOC (<1%) 5 files
*.inl59 LOC (<1%) 2 files
*.xs36 LOC (<1%) 1 files
*.sed1 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cocci
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
  • 145 files match defined criteria (34,606 lines of code, 0.3% vs. main code):
    • 128 *.c files (33,762 lines of code)
    • 10 *.h files (394 lines of code)
    • 1 *.py files (244 lines of code)
    • 3 *.cocci files (136 lines of code)
    • 3 *.sh files (70 lines of code)
  • " *.c" is biggest, containing 97.56% of code.
  • " *.sh" is smallest, containing 0.2% of code.


*.c33762 LOC (97%) 128 files
*.h394 LOC (1%) 10 files
*.py244 LOC (<1%) 1 files
*.cocci136 LOC (<1%) 3 files
*.sh70 LOC (<1%) 3 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]mk".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]mak".
  • 71 files match defined criteria (3,639 lines of code, 0.0% vs. main code):
    • 69 *.sh files (3,468 lines of code)
    • 1 *.mak files (165 lines of code)
    • 1 *.mk files (6 lines of code)
  • " *.sh" is biggest, containing 95.3% of code.
  • " *.mk" is smallest, containing 0.16% of code.


*.sh3468 LOC (95%) 69 files
*.mak165 LOC (4%) 1 files
*.mk6 LOC (<1%) 1 files
Other Code
txt
tex
sc
awk
xsl
vim
mk
rest
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]vim".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
  • 3116 files match defined criteria (380,776 lines of code, 2.8% vs. main code):
    • 2,861 *.txt files (314,987 lines of code)
    • 162 *.xml files (49,035 lines of code)
    • 58 *.c files (10,389 lines of code)
    • 4 *.pl files (1,836 lines of code)
    • 5 *.svg files (1,389 lines of code)
    • 5 *.h files (980 lines of code)
    • 1 *.tex files (914 lines of code)
    • 2 *.html files (378 lines of code)
    • 1 *.sc files (215 lines of code)
    • 1 *.mm files (180 lines of code)
    • 1 *.awk files (137 lines of code)
    • 4 *.sh files (100 lines of code)
    • 1 *.json files (72 lines of code)
    • 6 *.xsl files (70 lines of code)
    • 1 *.vim files (39 lines of code)
    • 1 *.mk files (28 lines of code)
    • 1 *.py files (16 lines of code)
    • 1 *.rest files (11 lines of code)
  • " *.txt" is biggest, containing 82.72% of code.
  • " *.rest" is smallest, containing 0% of code.


*.txt314987 LOC (82%) 2861 files
*.xml49035 LOC (12%) 162 files
*.c10389 LOC (2%) 58 files
*.pl1836 LOC (<1%) 4 files
*.svg1389 LOC (<1%) 5 files
*.h980 LOC (<1%) 5 files
*.tex914 LOC (<1%) 1 files
*.html378 LOC (<1%) 2 files
*.sc215 LOC (<1%) 1 files
*.mm180 LOC (<1%) 1 files
*.awk137 LOC (<1%) 1 files
*.sh100 LOC (<1%) 4 files
*.json72 LOC (<1%) 1 files
*.xsl70 LOC (<1%) 6 files
*.vim39 LOC (<1%) 1 files
*.mk28 LOC (<1%) 1 files
*.py16 LOC (<1%) 1 files
*.rest11 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.tst 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
  • *.gdbinit 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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 02:05