facebook / buck
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
plist
soy
j
ml
hs
properties
mk
in
proto
st
pro
s
watchmanconfig
cfg
patch
hs-boot
storyboard
diff
mli
flex
editorconfig
yy
nuspec
dae
project
mll
mly
gitattributes
ini
classpath
prefs
  • 67 extensions are included in analyses: java, txt, h, py, xml, plist, c, cpp, m, soy, j, bzl, sh, json, go, rs, swift, js, kt, ml, hs, properties, mk, md, bat, html, scala, in, d, rst, proto, groovy, st, hpp, gitignore, pro, css, thrift, s, yaml, watchmanconfig, cfg, ps1, patch, hs-boot, storyboard, xib, diff, cc, cs, asm, mli, flex, yml, editorconfig, yy, nuspec, dae, project, mm, mll, mly, gitattributes, ini, classpath, prefs, bash
  • 11 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/testdata/.*" (Test data) (3122 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (17 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (222 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (104 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (6 files).
    • exclude files with path like ".*/cache/.*" (Caches) (51 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (4 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (1244 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (0 files).
    • exclude files with path like ".*/target/.*" (Compiled files) (0 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.

main390279 LOC (55%) 4044 files
test300319 LOC (42%) 1924 files
generated12783 LOC (1%) 39 files
build and deployment1591 LOC (<1%) 15 files
other1766 LOC (<1%) 37 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
flex
proto
st
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 4044 files match defined criteria (390,279 lines of code, 100.0% vs. main code):
    • 3,922 *.java files (370,940 lines of code)
    • 69 *.py files (10,793 lines of code)
    • 6 *.c files (4,379 lines of code)
    • 9 *.xml files (1,129 lines of code)
    • 5 *.in files (719 lines of code)
    • 4 *.kt files (426 lines of code)
    • 1 *.bash files (393 lines of code)
    • 5 *.bzl files (376 lines of code)
    • 5 *.thrift files (354 lines of code)
    • 2 *.flex files (314 lines of code)
    • 2 *.proto files (230 lines of code)
    • 8 *.st files (128 lines of code)
    • 1 *.css files (40 lines of code)
    • 2 *.ps1 files (28 lines of code)
    • 2 *.h files (15 lines of code)
    • 1 *.yml files (15 lines of code)
  • " *.java" is biggest, containing 95.04% of code.
  • " *.yml" is smallest, containing 0% of code.


*.java370940 LOC (95%) 3922 files
*.py10793 LOC (2%) 69 files
*.c4379 LOC (1%) 6 files
*.xml1129 LOC (<1%) 9 files
*.in719 LOC (<1%) 5 files
*.kt426 LOC (<1%) 4 files
*.bash393 LOC (<1%) 1 files
*.bzl376 LOC (<1%) 5 files
*.thrift354 LOC (<1%) 5 files
*.flex314 LOC (<1%) 2 files
*.proto230 LOC (<1%) 2 files
*.st128 LOC (<1%) 8 files
*.css40 LOC (<1%) 1 files
*.ps128 LOC (<1%) 2 files
*.h15 LOC (<1%) 2 files
*.yml15 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]tests[-].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[-]test[-].*".
  • 1924 files match defined criteria (300,319 lines of code, 76.9% vs. main code):
    • 1,891 *.java files (295,814 lines of code)
    • 26 *.py files (4,323 lines of code)
    • 1 *.kt files (74 lines of code)
    • 2 *.js files (46 lines of code)
    • 1 *.in files (23 lines of code)
    • 1 *.bzl files (20 lines of code)
    • 1 *.html files (16 lines of code)
    • 1 *.sh files (3 lines of code)
  • " *.java" is biggest, containing 98.5% of code.
  • " *.sh" is smallest, containing 0% of code.


*.java295814 LOC (98%) 1891 files
*.py4323 LOC (1%) 26 files
*.kt74 LOC (<1%) 1 files
*.js46 LOC (<1%) 2 files
*.in23 LOC (<1%) 1 files
*.bzl20 LOC (<1%) 1 files
*.html16 LOC (<1%) 1 files
*.sh3 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/.*".
    • files with paths like ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
  • 39 files match defined criteria (12,783 lines of code, 3.3% vs. main code). All matches are in *.java files.


*.java12783 LOC (100%) 39 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
nuspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]mk".
    • files with paths like ".*/build[.]xml".
    • files with paths like ".*/[.]gitattributes".
  • 15 files match defined criteria (1,591 lines of code, 0.4% vs. main code):
    • 2 *.xml files (1,111 lines of code)
    • 9 *.sh files (378 lines of code)
    • 2 *.mk files (45 lines of code)
    • 1 *.nuspec files (33 lines of code)
    • 1 *.bat files (24 lines of code)
  • " *.xml" is biggest, containing 69.83% of code.
  • " *.bat" is smallest, containing 1.51% of code.


*.xml1111 LOC (69%) 2 files
*.sh378 LOC (23%) 9 files
*.mk45 LOC (2%) 2 files
*.nuspec33 LOC (2%) 1 files
*.bat24 LOC (1%) 1 files
Other Code
txt
soy
properties
plist
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]diff".
  • 37 files match defined criteria (1,766 lines of code, 0.5% vs. main code):
    • 10 *.txt files (679 lines of code)
    • 9 *.md files (416 lines of code)
    • 7 *.java files (307 lines of code)
    • 5 *.soy files (189 lines of code)
    • 3 *.json files (128 lines of code)
    • 2 *.properties files (26 lines of code)
    • 1 *.plist files (21 lines of code)
  • " *.txt" is biggest, containing 38.45% of code.
  • " *.plist" is smallest, containing 1.19% of code.


*.txt679 LOC (38%) 10 files
*.md416 LOC (23%) 9 files
*.java307 LOC (17%) 7 files
*.soy189 LOC (10%) 5 files
*.json128 LOC (7%) 3 files
*.properties26 LOC (1%) 2 files
*.plist21 LOC (1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.kt files are analyzed with KotlinAnalyzer:
    • 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 (based on imports and package statements)
  • *.bash files are analyzed with ShellAnalyzer:
    • 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
  • *.bzl 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
  • *.thrift files are analyzed with ThriftAnalyzer:
    • 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
  • *.flex 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
  • *.proto 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
  • *.st 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
  • *.ps1 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
  • *.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


2022-04-14 22:49