facebookincubator / Portal-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
cmd
asn1
l
y
awk
xsl
in
po
cfg
uc
ld
gdbinit
mk
reg
inl
vim
tex
glade
sc
xs
feature
mak
rest
  • 44 extensions are included in analyses: c, h, txt, s, xml, gitignore, sh, boot, cocci, pl, py, lds, cmd, asn1, l, y, awk, svg, xsl, in, inc, po, cfg, uc, ld, asm, gdbinit, mk, reg, md, html, inl, vim, tex, glade, sc, rst, cc, json, xs, feature, 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) (179 files).
    • exclude files with path like ".*/target/.*" (Compiled files) (104 files).
    • exclude files with path like ".*/cache/.*" (Caches) (9 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.

main14702602 LOC (96%) 44939 files
test47461 LOC (<1%) 206 files
generated3761 LOC (<1%) 67 files
build and deployment4507 LOC (<1%) 82 files
other423056 LOC (2%) 3783 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
cmd
awk
gdbinit
glade
lds
cfg
uc
asn1
boot
ld
in
inl
xs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 44939 files match defined criteria (14,702,602 lines of code, 100.0% vs. main code):
    • 23,226 *.c files (11,889,042 lines of code)
    • 21,443 *.h files (2,762,016 lines of code)
    • 32 *.pl files (17,704 lines of code)
    • 33 *.py files (6,523 lines of code)
    • 2 *.reg files (5,613 lines of code)
    • 8 *.y files (4,722 lines of code)
    • 5 *.po files (3,979 lines of code)
    • 51 *.cocci files (3,897 lines of code)
    • 8 *.l files (2,121 lines of code)
    • 1 *.cc files (1,579 lines of code)
    • 1 *.cmd files (1,064 lines of code)
    • 6 *.awk files (947 lines of code)
    • 3 *.gdbinit files (618 lines of code)
    • 1 *.glade files (603 lines of code)
    • 19 *.lds files (512 lines of code)
    • 4 *.cfg files (301 lines of code)
    • 4 *.uc files (278 lines of code)
    • 9 *.asn1 files (241 lines of code)
    • 5 *.inc files (236 lines of code)
    • 63 *.boot files (168 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)
  • " *.c" is biggest, containing 80.86% of code.
  • " *.xs" is smallest, containing 0% of code.


*.c11889042 LOC (80%) 23226 files
*.h2762016 LOC (18%) 21443 files
*.pl17704 LOC (<1%) 32 files
*.py6523 LOC (<1%) 33 files
*.reg5613 LOC (<1%) 2 files
*.y4722 LOC (<1%) 8 files
*.po3979 LOC (<1%) 5 files
*.cocci3897 LOC (<1%) 51 files
*.l2121 LOC (<1%) 8 files
*.cc1579 LOC (<1%) 1 files
*.cmd1064 LOC (<1%) 1 files
*.awk947 LOC (<1%) 6 files
*.gdbinit618 LOC (<1%) 3 files
*.glade603 LOC (<1%) 1 files
*.lds512 LOC (<1%) 19 files
*.cfg301 LOC (<1%) 4 files
*.uc278 LOC (<1%) 4 files
*.asn1241 LOC (<1%) 9 files
*.inc236 LOC (<1%) 5 files
*.boot168 LOC (<1%) 63 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
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 ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.]feature".
  • 206 files match defined criteria (47,461 lines of code, 0.3% vs. main code):
    • 176 *.c files (45,855 lines of code)
    • 16 *.h files (798 lines of code)
    • 1 *.py files (244 lines of code)
    • 3 *.cocci files (178 lines of code)
    • 8 *.sh files (162 lines of code)
    • 1 *.feature files (154 lines of code)
    • 1 *.awk files (70 lines of code)
  • " *.c" is biggest, containing 96.62% of code.
  • " *.awk" is smallest, containing 0.15% of code.


*.c45855 LOC (96%) 176 files
*.h798 LOC (1%) 16 files
*.py244 LOC (<1%) 1 files
*.cocci178 LOC (<1%) 3 files
*.sh162 LOC (<1%) 8 files
*.feature154 LOC (<1%) 1 files
*.awk70 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/.*".
  • 67 files match defined criteria (3,761 lines of code, 0.0% vs. main code). All matches are in *.h files.


*.h3761 LOC (100%) 67 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".
  • 82 files match defined criteria (4,507 lines of code, 0.0% vs. main code):
    • 79 *.sh files (4,168 lines of code)
    • 1 *.mak files (180 lines of code)
    • 2 *.mk files (159 lines of code)
  • " *.sh" is biggest, containing 92.48% of code.
  • " *.mk" is smallest, containing 3.53% of code.


*.sh4168 LOC (92%) 79 files
*.mak180 LOC (3%) 1 files
*.mk159 LOC (3%) 2 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 ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 3783 files match defined criteria (423,056 lines of code, 2.9% vs. main code):
    • 3,484 *.txt files (353,616 lines of code)
    • 175 *.xml files (49,474 lines of code)
    • 78 *.c files (12,467 lines of code)
    • 4 *.pl files (1,836 lines of code)
    • 5 *.svg files (1,389 lines of code)
    • 2 *.md files (1,113 lines of code)
    • 1 *.tex files (914 lines of code)
    • 6 *.h files (652 lines of code)
    • 11 *.sh files (413 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)
    • 1 *.json files (72 lines of code)
    • 6 *.xsl files (71 lines of code)
    • 1 *.vim files (39 lines of code)
    • 1 *.rst files (35 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 83.59% of code.
  • " *.rest" is smallest, containing 0% of code.


*.txt353616 LOC (83%) 3484 files
*.xml49474 LOC (11%) 175 files
*.c12467 LOC (2%) 78 files
*.pl1836 LOC (<1%) 4 files
*.svg1389 LOC (<1%) 5 files
*.md1113 LOC (<1%) 2 files
*.tex914 LOC (<1%) 1 files
*.h652 LOC (<1%) 6 files
*.sh413 LOC (<1%) 11 files
*.html378 LOC (<1%) 2 files
*.sc215 LOC (<1%) 1 files
*.mm180 LOC (<1%) 1 files
*.awk137 LOC (<1%) 1 files
*.json72 LOC (<1%) 1 files
*.xsl71 LOC (<1%) 6 files
*.vim39 LOC (<1%) 1 files
*.rst35 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-04-15 04:48