facebookresearch / habitat-sim
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
cmake
frag
vert
urdf
glsl
gitattributes
geom
editorconfig
in
ini
cfg
clang-format
toml
cu
cuh
gitmodules
clang-tidy
  • 35 extensions are included in analyses: h, cpp, py, json, txt, js, sh, cmake, md, rst, frag, inc, ipynb, vert, yaml, urdf, css, html, yml, gitignore, glsl, gitattributes, geom, editorconfig, c, in, svg, ini, cfg, clang-format, toml, cu, cuh, gitmodules, clang-tidy
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (17 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (19 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 ".*/deps/.*" (Dependencies) (63 files).
    • exclude files with path like ".*[.]txt" (Text files) (23 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.

main54025 LOC (67%) 402 files
test10814 LOC (13%) 61 files
generated0 LOC (0%) 0 files
build and deployment427 LOC (<1%) 12 files
other14497 LOC (18%) 84 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
frag
cu
vert
glsl
cfg
toml
cuh
geom
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 402 files match defined criteria (54,025 lines of code, 100.0% vs. main code):
    • 133 *.cpp files (27,661 lines of code)
    • 151 *.h files (14,926 lines of code)
    • 59 *.py files (5,449 lines of code)
    • 13 *.cmake files (3,455 lines of code)
    • 10 *.js files (910 lines of code)
    • 11 *.frag files (780 lines of code)
    • 1 *.cu files (159 lines of code)
    • 6 *.vert files (154 lines of code)
    • 5 *.yaml files (134 lines of code)
    • 2 *.glsl files (95 lines of code)
    • 3 *.html files (92 lines of code)
    • 2 *.css files (71 lines of code)
    • 1 *.cfg files (45 lines of code)
    • 1 *.toml files (35 lines of code)
    • 1 *.cuh files (29 lines of code)
    • 1 *.geom files (23 lines of code)
    • 1 *.yml files (6 lines of code)
    • 1 *.in files (1 lines of code)
  • " *.cpp" is biggest, containing 51.2% of code.
  • " *.in" is smallest, containing 0% of code.


*.cpp27661 LOC (51%) 133 files
*.h14926 LOC (27%) 151 files
*.py5449 LOC (10%) 59 files
*.cmake3455 LOC (6%) 13 files
*.js910 LOC (1%) 10 files
*.frag780 LOC (1%) 11 files
*.cu159 LOC (<1%) 1 files
*.vert154 LOC (<1%) 6 files
*.yaml134 LOC (<1%) 5 files
*.glsl95 LOC (<1%) 2 files
*.html92 LOC (<1%) 3 files
*.css71 LOC (<1%) 2 files
*.cfg45 LOC (<1%) 1 files
*.toml35 LOC (<1%) 1 files
*.cuh29 LOC (<1%) 1 files
*.geom23 LOC (<1%) 1 files
*.yml6 LOC (<1%) 1 files
*.in1 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
urdf
cmake
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[.].*".
    • files with paths like ".*[.]test[.].*".
  • 61 files match defined criteria (10,814 lines of code, 20.0% vs. main code):
    • 22 *.cpp files (5,689 lines of code)
    • 26 *.py files (3,629 lines of code)
    • 6 *.urdf files (1,210 lines of code)
    • 5 *.js files (258 lines of code)
    • 1 *.html files (21 lines of code)
    • 1 *.cmake files (7 lines of code)
  • " *.cpp" is biggest, containing 52.61% of code.
  • " *.cmake" is smallest, containing 0.06% of code.


*.cpp5689 LOC (52%) 22 files
*.py3629 LOC (33%) 26 files
*.urdf1210 LOC (11%) 6 files
*.js258 LOC (2%) 5 files
*.html21 LOC (<1%) 1 files
*.cmake7 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 ".*/[.]gitmodules".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/[.]gitattributes".
  • 12 files match defined criteria (427 lines of code, 0.8% vs. main code):
    • 11 *.sh files (375 lines of code)
    • 1 *.js files (52 lines of code)
  • " *.sh" is biggest, containing 87.82% of code.
  • " *.js" is smallest, containing 12.18% of code.


*.sh375 LOC (87%) 11 files
*.js52 LOC (12%) 1 files
Other Code
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 84 files match defined criteria (14,497 lines of code, 26.8% vs. main code):
    • 25 *.py files (6,943 lines of code)
    • 6 *.ipynb files (5,633 lines of code)
    • 34 *.json files (677 lines of code)
    • 6 *.js files (646 lines of code)
    • 8 *.md files (499 lines of code)
    • 2 *.sh files (49 lines of code)
    • 1 *.html files (22 lines of code)
    • 1 *.ini files (21 lines of code)
    • 1 *.css files (7 lines of code)
  • " *.py" is biggest, containing 47.89% of code.
  • " *.css" is smallest, containing 0.05% of code.


*.py6943 LOC (47%) 25 files
*.ipynb5633 LOC (38%) 6 files
*.json677 LOC (4%) 34 files
*.js646 LOC (4%) 6 files
*.md499 LOC (3%) 8 files
*.sh49 LOC (<1%) 2 files
*.html22 LOC (<1%) 1 files
*.ini21 LOC (<1%) 1 files
*.css7 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
  • *.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
  • *.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
  • *.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
  • *.frag 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
  • *.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
  • *.vert 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
  • *.glsl 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.cuh 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
  • *.geom 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
  • *.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
  • *.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


2022-01-25 19:41