facebook / infer
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
ml
mli
smt2
txt
make
in
al
sml
mll
m4
mly
plist
patch
mk
clang-format
storyboard
sig
org
p
properties
sexp
adoc
pro
gitattributes
s
prettierignore
  • 48 extensions are included in analyses: html, ml, mli, java, cpp, m, md, c, h, smt2, erl, mm, txt, make, sh, xml, in, json, al, sml, js, mll, gitignore, m4, css, mly, plist, kt, py, patch, mk, clang-format, storyboard, escript, sig, svg, gradle, yml, org, p, properties, sexp, xib, adoc, pro, gitattributes, s, prettierignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (52 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (14 files).
    • exclude files with path like ".*/dependencies/.*" (Dependencies) (1 file).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (1 file).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (0 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (3 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (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.

main203773 LOC (59%) 1883 files
test92634 LOC (26%) 1773 files
generated13500 LOC (3%) 30 files
build and deployment881 LOC (<1%) 15 files
other34055 LOC (9%) 378 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ml
mli
sml
mly
mll
in
org
p
al
sexp
adoc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1883 files match defined criteria (203,773 lines of code, 100.0% vs. main code):
    • 658 *.ml files (149,348 lines of code)
    • 585 *.mli files (22,529 lines of code)
    • 11 *.sml files (9,848 lines of code)
    • 20 *.h files (4,761 lines of code)
    • 16 *.c files (3,996 lines of code)
    • 158 *.java files (3,915 lines of code)
    • 368 *.html files (2,504 lines of code)
    • 5 *.css files (1,829 lines of code)
    • 4 *.mly files (1,165 lines of code)
    • 5 *.mll files (867 lines of code)
    • 15 *.m files (465 lines of code)
    • 12 *.in files (457 lines of code)
    • 2 *.org files (443 lines of code)
    • 5 *.js files (396 lines of code)
    • 2 *.escript files (388 lines of code)
    • 8 *.cpp files (340 lines of code)
    • 2 *.p files (210 lines of code)
    • 1 *.al files (178 lines of code)
    • 2 *.py files (59 lines of code)
    • 2 *.sexp files (32 lines of code)
    • 1 *.erl files (22 lines of code)
    • 1 *.adoc files (21 lines of code)
  • " *.ml" is biggest, containing 73.29% of code.
  • " *.adoc" is smallest, containing 0.01% of code.


*.ml149348 LOC (73%) 658 files
*.mli22529 LOC (11%) 585 files
*.sml9848 LOC (4%) 11 files
*.h4761 LOC (2%) 20 files
*.c3996 LOC (1%) 16 files
*.java3915 LOC (1%) 158 files
*.html2504 LOC (1%) 368 files
*.css1829 LOC (<1%) 5 files
*.mly1165 LOC (<1%) 4 files
*.mll867 LOC (<1%) 5 files
*.m465 LOC (<1%) 15 files
*.in457 LOC (<1%) 12 files
*.org443 LOC (<1%) 2 files
*.js396 LOC (<1%) 5 files
*.escript388 LOC (<1%) 2 files
*.cpp340 LOC (<1%) 8 files
*.p210 LOC (<1%) 2 files
*.al178 LOC (<1%) 1 files
*.py59 LOC (<1%) 2 files
*.sexp32 LOC (<1%) 2 files
*.erl22 LOC (<1%) 1 files
*.adoc21 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
smt2
ml
al
make
mli
in
mk
sig
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/UnitTests?/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/src/androidTest/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*_tests[.].*".
  • 1773 files match defined criteria (92,634 lines of code, 45.5% vs. main code):
    • 374 *.java files (30,542 lines of code)
    • 511 *.cpp files (21,381 lines of code)
    • 312 *.m files (10,566 lines of code)
    • 65 *.smt2 files (10,151 lines of code)
    • 270 *.c files (9,686 lines of code)
    • 41 *.erl files (3,837 lines of code)
    • 13 *.ml files (2,313 lines of code)
    • 41 *.mm files (1,256 lines of code)
    • 10 *.al files (1,085 lines of code)
    • 81 *.h files (765 lines of code)
    • 20 *.make files (479 lines of code)
    • 8 *.xml files (156 lines of code)
    • 6 *.sh files (86 lines of code)
    • 4 *.kt files (75 lines of code)
    • 1 *.escript files (70 lines of code)
    • 3 *.mli files (61 lines of code)
    • 4 *.html files (44 lines of code)
    • 2 *.in files (34 lines of code)
    • 3 *.mk files (26 lines of code)
    • 1 *.py files (14 lines of code)
    • 3 *.sig files (7 lines of code)
  • " *.java" is biggest, containing 32.97% of code.
  • " *.sig" is smallest, containing 0.01% of code.


*.java30542 LOC (32%) 374 files
*.cpp21381 LOC (23%) 511 files
*.m10566 LOC (11%) 312 files
*.smt210151 LOC (10%) 65 files
*.c9686 LOC (10%) 270 files
*.erl3837 LOC (4%) 41 files
*.ml2313 LOC (2%) 13 files
*.mm1256 LOC (1%) 41 files
*.al1085 LOC (1%) 10 files
*.h765 LOC (<1%) 81 files
*.make479 LOC (<1%) 20 files
*.xml156 LOC (<1%) 8 files
*.sh86 LOC (<1%) 6 files
*.kt75 LOC (<1%) 4 files
*.escript70 LOC (<1%) 1 files
*.mli61 LOC (<1%) 3 files
*.html44 LOC (<1%) 4 files
*.in34 LOC (<1%) 2 files
*.mk26 LOC (<1%) 3 files
*.py14 LOC (<1%) 1 files
*.sig7 LOC (<1%) 3 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 ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
  • 30 files match defined criteria (13,500 lines of code, 6.6% vs. main code). All matches are in *.html files.


*.html13500 LOC (100%) 30 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
make
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]make".
    • files with paths like ".*/build[.]xml".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*[.]mk".
  • 15 files match defined criteria (881 lines of code, 0.4% vs. main code):
    • 12 *.sh files (754 lines of code)
    • 2 *.xml files (110 lines of code)
    • 1 *.make files (17 lines of code)
  • " *.sh" is biggest, containing 85.58% of code.
  • " *.make" is smallest, containing 1.93% of code.


*.sh754 LOC (85%) 12 files
*.xml110 LOC (12%) 2 files
*.make17 LOC (1%) 1 files
Other Code
txt
plist
patch
storyboard
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/[Mm]an/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/INSTALL[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]patch".
  • 378 files match defined criteria (34,055 lines of code, 16.7% vs. main code):
    • 30 *.html files (13,500 lines of code)
    • 241 *.md files (13,086 lines of code)
    • 30 *.txt files (5,296 lines of code)
    • 12 *.json files (920 lines of code)
    • 24 *.java files (296 lines of code)
    • 3 *.svg files (272 lines of code)
    • 4 *.plist files (129 lines of code)
    • 3 *.patch files (122 lines of code)
    • 6 *.m files (115 lines of code)
    • 3 *.storyboard files (75 lines of code)
    • 5 *.c files (73 lines of code)
    • 7 *.xml files (50 lines of code)
    • 1 *.xib files (41 lines of code)
    • 3 *.gradle files (37 lines of code)
    • 3 *.h files (16 lines of code)
    • 1 *.properties files (14 lines of code)
    • 1 *.sh files (9 lines of code)
    • 1 *.cpp files (4 lines of code)
  • " *.html" is biggest, containing 39.64% of code.
  • " *.cpp" is smallest, containing 0.01% of code.


*.html13500 LOC (39%) 30 files
*.md13086 LOC (38%) 241 files
*.txt5296 LOC (15%) 30 files
*.json920 LOC (2%) 12 files
*.java296 LOC (<1%) 24 files
*.svg272 LOC (<1%) 3 files
*.plist129 LOC (<1%) 4 files
*.patch122 LOC (<1%) 3 files
*.m115 LOC (<1%) 6 files
*.storyboard75 LOC (<1%) 3 files
*.c73 LOC (<1%) 5 files
*.xml50 LOC (<1%) 7 files
*.xib41 LOC (<1%) 1 files
*.gradle37 LOC (<1%) 3 files
*.h16 LOC (<1%) 3 files
*.properties14 LOC (<1%) 1 files
*.sh9 LOC (<1%) 1 files
*.cpp4 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.ml 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
  • *.mli 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
  • *.sml 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
  • *.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
  • *.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
  • *.java 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)
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.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
  • *.mly 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
  • *.mll 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
  • *.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
  • *.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
  • *.org 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
  • *.js 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
  • *.escript 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
  • *.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
  • *.p files are analyzed with ObjectPascalAnalyzer:
    • 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
  • *.al 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
  • *.sexp 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
  • *.erl 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
  • *.adoc 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-14 23:00