facebookincubator / FBOpenSSH
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
pub
fp
bb
in
n
spec
ms
p
q
krl
g
m4
arcconfig
txt
awk
csh
  • 24 extensions are included in analyses: c, h, sh, pub, fp, bb, in, cc, md, n, spec, ms, p, q, json, inc, krl, gitignore, g, m4, arcconfig, txt, awk, csh
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (2 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (83 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (1 file).
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.

main104268 LOC (89%) 396 files
test5089 LOC (4%) 15 files
generated0 LOC (0%) 0 files
build and deployment6940 LOC (5%) 99 files
other277 LOC (<1%) 6 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
spec
in
awk
ms
krl
pub
csh
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 396 files match defined criteria (104,268 lines of code, 100.0% vs. main code):
    • 253 *.c files (91,751 lines of code)
    • 118 *.h files (8,511 lines of code)
    • 3 *.spec files (1,574 lines of code)
    • 8 *.in files (1,534 lines of code)
    • 1 *.awk files (363 lines of code)
    • 2 *.ms files (187 lines of code)
    • 6 *.cc files (149 lines of code)
    • 1 *.krl files (118 lines of code)
    • 1 *.inc files (66 lines of code)
    • 2 *.pub files (14 lines of code)
    • 1 *.csh files (1 lines of code)
  • " *.c" is biggest, containing 88% of code.
  • " *.csh" is smallest, containing 0% of code.


*.c91751 LOC (87%) 253 files
*.h8511 LOC (8%) 118 files
*.spec1574 LOC (1%) 3 files
*.in1534 LOC (1%) 8 files
*.awk363 LOC (<1%) 1 files
*.ms187 LOC (<1%) 2 files
*.cc149 LOC (<1%) 6 files
*.krl118 LOC (<1%) 1 files
*.inc66 LOC (<1%) 1 files
*.pub14 LOC (<1%) 2 files
*.csh1 LOC (<1%) 1 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_.*".
  • 15 files match defined criteria (5,089 lines of code, 4.9% vs. main code):
    • 14 *.c files (4,818 lines of code)
    • 1 *.h files (271 lines of code)
  • " *.c" is biggest, containing 94.67% of code.
  • " *.h" is smallest, containing 5.33% of code.


*.c4818 LOC (94%) 14 files
*.h271 LOC (5%) 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".
  • 99 files match defined criteria (6,940 lines of code, 6.7% vs. main code). All matches are in *.sh files.


*.sh6940 LOC (100%) 99 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
  • 6 files match defined criteria (277 lines of code, 0.3% vs. main code):
    • 5 *.md files (205 lines of code)
    • 1 *.json files (72 lines of code)
  • " *.md" is biggest, containing 74.01% of code.
  • " *.json" is smallest, containing 25.99% of code.


*.md205 LOC (74%) 5 files
*.json72 LOC (25%) 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
  • *.spec 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
  • *.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
  • *.ms 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
  • *.krl 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
  • *.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
  • *.csh 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:01