facebookresearch / fastText
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
cc
in
txt
cfg
  • 17 extensions are included in analyses: html, js, md, py, sh, cc, h, css, json, in, txt, rst, cpp, cfg, gitignore, yml, pl
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (344 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (10 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).
    • exclude files with path like ".*[.]txt" (Text files) (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.

main7545 LOC (71%) 58 files
test889 LOC (8%) 4 files
generated0 LOC (0%) 0 files
build and deployment454 LOC (4%) 15 files
other1655 LOC (15%) 26 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cc
in
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 58 files match defined criteria (7,545 lines of code, 100.0% vs. main code):
    • 18 *.cc files (4,478 lines of code)
    • 15 *.py files (1,363 lines of code)
    • 14 *.h files (891 lines of code)
    • 5 *.js files (628 lines of code)
    • 1 *.cpp files (90 lines of code)
    • 1 *.pl files (43 lines of code)
    • 1 *.css files (37 lines of code)
    • 2 *.in files (13 lines of code)
    • 1 *.cfg files (2 lines of code)
  • " *.cc" is biggest, containing 59.35% of code.
  • " *.cfg" is smallest, containing 0.03% of code.


*.cc4478 LOC (59%) 18 files
*.py1363 LOC (18%) 15 files
*.h891 LOC (11%) 14 files
*.js628 LOC (8%) 5 files
*.cpp90 LOC (1%) 1 files
*.pl43 LOC (<1%) 1 files
*.css37 LOC (<1%) 1 files
*.in13 LOC (<1%) 2 files
*.cfg2 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 ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
  • 4 files match defined criteria (889 lines of code, 11.8% vs. main code):
    • 3 *.py files (739 lines of code)
    • 1 *.sh files (150 lines of code)
  • " *.py" is biggest, containing 83.13% of code.
  • " *.sh" is smallest, containing 16.87% of code.


*.py739 LOC (83%) 3 files
*.sh150 LOC (16%) 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 ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 15 files match defined criteria (454 lines of code, 6.0% vs. main code). All matches are in *.sh files.


*.sh454 LOC (100%) 15 files
Other Code
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 ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
  • 26 files match defined criteria (1,655 lines of code, 21.9% vs. main code):
    • 12 *.md files (829 lines of code)
    • 6 *.py files (319 lines of code)
    • 2 *.rst files (304 lines of code)
    • 4 *.html files (173 lines of code)
    • 2 *.json files (30 lines of code)
  • " *.md" is biggest, containing 50.09% of code.
  • " *.json" is smallest, containing 1.81% of code.


*.md829 LOC (50%) 12 files
*.py319 LOC (19%) 6 files
*.rst304 LOC (18%) 2 files
*.html173 LOC (10%) 4 files
*.json30 LOC (1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.pl files are analyzed with PerlAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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


2022-01-25 19:29