facebookincubator / hsthrift
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
hs
cmake
cabal
hsc
project
txt
x
y
  • 18 extensions are included in analyses: hs, thrift, py, h, cpp, cmake, md, cabal, hsc, sh, project, gitignore, c, txt, x, json, yml, y
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (6 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (4 files).
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (1 file).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (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.

main32011 LOC (63%) 238 files
test17778 LOC (35%) 315 files
generated0 LOC (0%) 0 files
build and deployment237 LOC (<1%) 5 files
other350 LOC (<1%) 10 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
hs
cmake
hsc
cabal
y
x
project
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 238 files match defined criteria (32,011 lines of code, 100.0% vs. main code):
    • 132 *.hs files (17,407 lines of code)
    • 27 *.py files (6,075 lines of code)
    • 20 *.cmake files (2,103 lines of code)
    • 21 *.h files (1,617 lines of code)
    • 8 *.hsc files (1,437 lines of code)
    • 8 *.cabal files (1,231 lines of code)
    • 14 *.cpp files (1,027 lines of code)
    • 1 *.y files (722 lines of code)
    • 1 *.x files (236 lines of code)
    • 1 *.c files (74 lines of code)
    • 3 *.project files (45 lines of code)
    • 2 *.thrift files (37 lines of code)
  • " *.hs" is biggest, containing 54.38% of code.
  • " *.thrift" is smallest, containing 0.12% of code.


*.hs17407 LOC (54%) 132 files
*.py6075 LOC (18%) 27 files
*.cmake2103 LOC (6%) 20 files
*.h1617 LOC (5%) 21 files
*.hsc1437 LOC (4%) 8 files
*.cabal1231 LOC (3%) 8 files
*.cpp1027 LOC (3%) 14 files
*.y722 LOC (2%) 1 files
*.x236 LOC (<1%) 1 files
*.c74 LOC (<1%) 1 files
*.project45 LOC (<1%) 3 files
*.thrift37 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
hs
cabal
hsc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*/[Ss]pecs/.*".
  • 315 files match defined criteria (17,778 lines of code, 55.5% vs. main code):
    • 117 *.hs files (10,480 lines of code)
    • 161 *.thrift files (5,842 lines of code)
    • 19 *.py files (562 lines of code)
    • 10 *.cpp files (506 lines of code)
    • 1 *.cabal files (267 lines of code)
    • 4 *.h files (52 lines of code)
    • 1 *.hsc files (36 lines of code)
    • 2 *.sh files (33 lines of code)
  • " *.hs" is biggest, containing 58.95% of code.
  • " *.sh" is smallest, containing 0.19% of code.


*.hs10480 LOC (58%) 117 files
*.thrift5842 LOC (32%) 161 files
*.py562 LOC (3%) 19 files
*.cpp506 LOC (2%) 10 files
*.cabal267 LOC (1%) 1 files
*.h52 LOC (<1%) 4 files
*.hsc36 LOC (<1%) 1 files
*.sh33 LOC (<1%) 2 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".
  • 5 files match defined criteria (237 lines of code, 0.7% vs. main code). All matches are in *.sh files.


*.sh237 LOC (100%) 5 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".
    • files with paths like ".*[.]txt".
  • 10 files match defined criteria (350 lines of code, 1.1% vs. main code):
    • 9 *.md files (278 lines of code)
    • 1 *.json files (72 lines of code)
  • " *.md" is biggest, containing 79.43% of code.
  • " *.json" is smallest, containing 20.57% of code.


*.md278 LOC (79%) 9 files
*.json72 LOC (20%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.hs 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
  • *.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
  • *.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
  • *.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
  • *.hsc 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
  • *.cabal 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
  • *.y 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
  • *.x 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
  • *.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
  • *.project 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


2022-04-15 05:05