facebookincubator / antlir
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
handlebars
jinja2
spec
txt
watchmanconfig
patch
gitmodules
mdx
cfg
awk
xslt
pub
prettierignore
  • 29 extensions are included in analyses: py, bzl, rs, md, toml, handlebars, js, jinja2, yml, spec, thrift, gitignore, svg, cpp, sh, h, css, json, c, txt, watchmanconfig, patch, gitmodules, mdx, cfg, awk, xslt, pub, prettierignore
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (16 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (26 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (11 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.

main42297 LOC (64%) 404 files
test22563 LOC (34%) 198 files
generated0 LOC (0%) 0 files
build and deployment78 LOC (<1%) 2 files
other499 LOC (<1%) 13 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
handlebars
jinja2
xslt
cfg
pub
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 404 files match defined criteria (42,297 lines of code, 100.0% vs. main code):
    • 140 *.py files (16,594 lines of code)
    • 87 *.rs files (13,858 lines of code)
    • 123 *.bzl files (10,092 lines of code)
    • 21 *.toml files (544 lines of code)
    • 6 *.js files (477 lines of code)
    • 2 *.c files (363 lines of code)
    • 3 *.thrift files (97 lines of code)
    • 2 *.css files (95 lines of code)
    • 8 *.handlebars files (64 lines of code)
    • 6 *.jinja2 files (56 lines of code)
    • 1 *.xslt files (40 lines of code)
    • 1 *.cfg files (9 lines of code)
    • 3 *.h files (7 lines of code)
    • 1 *.pub files (1 lines of code)
  • " *.py" is biggest, containing 39.23% of code.
  • " *.pub" is smallest, containing 0% of code.


*.py16594 LOC (39%) 140 files
*.rs13858 LOC (32%) 87 files
*.bzl10092 LOC (23%) 123 files
*.toml544 LOC (1%) 21 files
*.js477 LOC (1%) 6 files
*.c363 LOC (<1%) 2 files
*.thrift97 LOC (<1%) 3 files
*.css95 LOC (<1%) 2 files
*.handlebars64 LOC (<1%) 8 files
*.jinja256 LOC (<1%) 6 files
*.xslt40 LOC (<1%) 1 files
*.cfg9 LOC (<1%) 1 files
*.h7 LOC (<1%) 3 files
*.pub1 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
spec
jinja2
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 ".*_tests[.].*".
  • 198 files match defined criteria (22,563 lines of code, 53.3% vs. main code):
    • 154 *.py files (21,079 lines of code)
    • 22 *.rs files (928 lines of code)
    • 7 *.bzl files (309 lines of code)
    • 4 *.toml files (92 lines of code)
    • 5 *.spec files (90 lines of code)
    • 3 *.cpp files (39 lines of code)
    • 2 *.thrift files (19 lines of code)
    • 1 *.jinja2 files (7 lines of code)
  • " *.py" is biggest, containing 93.42% of code.
  • " *.jinja2" is smallest, containing 0.03% of code.


*.py21079 LOC (93%) 154 files
*.rs928 LOC (4%) 22 files
*.bzl309 LOC (1%) 7 files
*.toml92 LOC (<1%) 4 files
*.spec90 LOC (<1%) 5 files
*.cpp39 LOC (<1%) 3 files
*.thrift19 LOC (<1%) 2 files
*.jinja27 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitmodules".
  • 2 files match defined criteria (78 lines of code, 0.2% vs. main code). All matches are in *.sh files.


*.sh78 LOC (100%) 2 files
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]mdx".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]patch".
  • 13 files match defined criteria (499 lines of code, 1.2% vs. main code):
    • 6 *.md files (158 lines of code)
    • 3 *.py files (152 lines of code)
    • 2 *.json files (132 lines of code)
    • 1 *.svg files (56 lines of code)
    • 1 *.txt files (1 lines of code)
  • " *.md" is biggest, containing 31.66% of code.
  • " *.txt" is smallest, containing 0.2% of code.


*.md158 LOC (31%) 6 files
*.py152 LOC (30%) 3 files
*.json132 LOC (26%) 2 files
*.svg56 LOC (11%) 1 files
*.txt1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.rs 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
  • *.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
  • *.toml 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
  • *.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
  • *.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
  • *.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
  • *.handlebars 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
  • *.jinja2 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
  • *.xslt 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
  • *.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
  • *.pub 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 05:02