facebookexperimental / skybison
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
in
cmake
s
pck
m4
clang-format
clang-tidy
plist
pyw
ini
ps
patch
vbs
mak
man
cfg
fish
lisp
pro
xsl
filters
command
csh
  • 45 extensions are included in analyses: py, h, rst, c, cpp, txt, cc, xml, md, yml, in, sh, json, cmake, svg, html, m, d, gitignore, s, inc, pck, m4, clang-format, clang-tidy, js, plist, pyw, ini, css, ps, patch, vbs, mak, man, cfg, fish, asm, ps1, lisp, pro, xsl, filters, command, csh
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (59 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (4091 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (0 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (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.

main213488 LOC (83%) 628 files
test37222 LOC (14%) 368 files
generated0 LOC (0%) 0 files
build and deployment150 LOC (<1%) 2 files
other5071 LOC (1%) 27 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 628 files match defined criteria (213,488 lines of code, 100.0% vs. main code):
    • 304 *.cpp files (150,335 lines of code)
    • 111 *.py files (41,710 lines of code)
    • 209 *.h files (18,768 lines of code)
    • 4 *.cmake files (2,675 lines of code)
  • " *.cpp" is biggest, containing 70.42% of code.
  • " *.cmake" is smallest, containing 1.25% of code.


*.cpp150335 LOC (70%) 304 files
*.py41710 LOC (19%) 111 files
*.h18768 LOC (8%) 209 files
*.cmake2675 LOC (1%) 4 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*[-]tests[-].*".
  • 368 files match defined criteria (37,222 lines of code, 17.4% vs. main code):
    • 361 *.py files (36,838 lines of code)
    • 4 *.cpp files (278 lines of code)
    • 2 *.h files (90 lines of code)
    • 1 *.sh files (16 lines of code)
  • " *.py" is biggest, containing 98.97% of code.
  • " *.sh" is smallest, containing 0.04% of code.


*.py36838 LOC (98%) 361 files
*.cpp278 LOC (<1%) 4 files
*.h90 LOC (<1%) 2 files
*.sh16 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]mak".
  • 2 files match defined criteria (150 lines of code, 0.1% vs. main code). All matches are in *.sh files.


*.sh150 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 ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/INSTALL[.][a-z0-9]+".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/[Ss]amples/.*".
  • 27 files match defined criteria (5,071 lines of code, 2.4% vs. main code):
    • 13 *.txt files (3,634 lines of code)
    • 13 *.md files (1,365 lines of code)
    • 1 *.json files (72 lines of code)
  • " *.txt" is biggest, containing 71.66% of code.
  • " *.json" is smallest, containing 1.42% of code.


*.txt3634 LOC (71%) 13 files
*.md1365 LOC (26%) 13 files
*.json72 LOC (1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.cmake 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-16 06:52