facebookresearch / FAMBench
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
txt
gn
cfg
clang-format
toml
cu
gitmodules
  • 22 extensions are included in analyses: py, sh, md, cc, h, txt, svg, gitignore, html, yaml, gn, css, xml, json, yml, ipynb, cpp, cfg, clang-format, toml, cu, gitmodules
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (13 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 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) (4 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.

main18179 LOC (77%) 108 files
test1554 LOC (6%) 13 files
generated81 LOC (<1%) 1 files
build and deployment1648 LOC (7%) 44 files
other1846 LOC (7%) 24 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cc
cu
toml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 108 files match defined criteria (18,179 lines of code, 100.0% vs. main code):
    • 88 *.py files (12,986 lines of code)
    • 7 *.cc files (3,209 lines of code)
    • 8 *.h files (884 lines of code)
    • 1 *.cu files (599 lines of code)
    • 1 *.cpp files (258 lines of code)
    • 1 *.yml files (127 lines of code)
    • 1 *.toml files (65 lines of code)
    • 1 *.yaml files (51 lines of code)
  • " *.py" is biggest, containing 71.43% of code.
  • " *.yaml" is smallest, containing 0.28% of code.


*.py12986 LOC (71%) 88 files
*.cc3209 LOC (17%) 7 files
*.h884 LOC (4%) 8 files
*.cu599 LOC (3%) 1 files
*.cpp258 LOC (1%) 1 files
*.yml127 LOC (<1%) 1 files
*.toml65 LOC (<1%) 1 files
*.yaml51 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cc
gn
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[.].*".
    • files with paths like ".*/[Tt]est/.*".
  • 13 files match defined criteria (1,554 lines of code, 8.5% vs. main code):
    • 4 *.cc files (1,022 lines of code)
    • 4 *.h files (378 lines of code)
    • 2 *.py files (70 lines of code)
    • 2 *.sh files (63 lines of code)
    • 1 *.gn files (21 lines of code)
  • " *.cc" is biggest, containing 65.77% of code.
  • " *.gn" is smallest, containing 1.35% of code.


*.cc1022 LOC (65%) 4 files
*.h378 LOC (24%) 4 files
*.py70 LOC (4%) 2 files
*.sh63 LOC (4%) 2 files
*.gn21 LOC (1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
cc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/generated/.*".
    • files with paths like ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
  • 1 file matches defined criteria (81 lines of code, 0.4% vs. main code). All matches are in *.cc files.


*.cc81 LOC (100%) 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 ".*/[.]gitmodules".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/docker[-]compose[.]yaml".
  • 44 files match defined criteria (1,648 lines of code, 9.1% vs. main code):
    • 43 *.sh files (1,631 lines of code)
    • 1 *.yaml files (17 lines of code)
  • " *.sh" is biggest, containing 98.97% of code.
  • " *.yaml" is smallest, containing 1.03% of code.


*.sh1631 LOC (98%) 43 files
*.yaml17 LOC (1%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 24 files match defined criteria (1,846 lines of code, 10.2% vs. main code):
    • 18 *.md files (1,500 lines of code)
    • 5 *.py files (261 lines of code)
    • 1 *.svg files (85 lines of code)
  • " *.md" is biggest, containing 81.26% of code.
  • " *.svg" is smallest, containing 4.6% of code.


*.md1500 LOC (81%) 18 files
*.py261 LOC (14%) 5 files
*.svg85 LOC (4%) 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
  • *.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
  • *.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
  • *.cu 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
  • *.yml files are analyzed with YamlAnalyzer:
    • 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
  • *.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
  • *.yaml files are analyzed with YamlAnalyzer:
    • 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 20:18