facebookresearch / pytorch3d
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
cu
cuh
obj
mtl
pt
txt
dockerignore
cfg
clang-format
  • 25 extensions are included in analyses: py, h, cpp, cu, md, rst, sh, ipynb, yaml, cuh, js, json, bat, svg, obj, yml, gitignore, mtl, css, pt, txt, dockerignore, cfg, clang-format, bash
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (18 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (59 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.

main36604 LOC (56%) 281 files
test25994 LOC (39%) 135 files
generated0 LOC (0%) 0 files
build and deployment662 LOC (1%) 18 files
other2016 LOC (3%) 19 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cu
cuh
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 281 files match defined criteria (36,604 lines of code, 100.0% vs. main code):
    • 119 *.py files (16,659 lines of code)
    • 67 *.h files (6,888 lines of code)
    • 30 *.cu files (5,188 lines of code)
    • 35 *.cpp files (3,905 lines of code)
    • 9 *.cuh files (2,336 lines of code)
    • 8 *.js files (580 lines of code)
    • 2 *.css files (471 lines of code)
    • 9 *.yaml files (316 lines of code)
    • 1 *.bash files (253 lines of code)
    • 1 *.cfg files (8 lines of code)
  • " *.py" is biggest, containing 45.51% of code.
  • " *.cfg" is smallest, containing 0.02% of code.


*.py16659 LOC (45%) 119 files
*.h6888 LOC (18%) 67 files
*.cu5188 LOC (14%) 30 files
*.cpp3905 LOC (10%) 35 files
*.cuh2336 LOC (6%) 9 files
*.js580 LOC (1%) 8 files
*.css471 LOC (1%) 2 files
*.yaml316 LOC (<1%) 9 files
*.bash253 LOC (<1%) 1 files
*.cfg8 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
obj
mtl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
  • 135 files match defined criteria (25,994 lines of code, 71.0% vs. main code):
    • 130 *.py files (25,957 lines of code)
    • 3 *.obj files (24 lines of code)
    • 2 *.mtl files (13 lines of code)
  • " *.py" is biggest, containing 99.86% of code.
  • " *.mtl" is smallest, containing 0.05% of code.


*.py25957 LOC (99%) 130 files
*.obj24 LOC (<1%) 3 files
*.mtl13 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 ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
  • 18 files match defined criteria (662 lines of code, 1.8% vs. main code):
    • 11 *.sh files (428 lines of code)
    • 7 *.bat files (234 lines of code)
  • " *.sh" is biggest, containing 64.65% of code.
  • " *.bat" is smallest, containing 35.35% of code.


*.sh428 LOC (64%) 11 files
*.bat234 LOC (35%) 7 files
Other Code
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 ".*[.]json".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/INSTALL[.][a-z0-9]+".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 19 files match defined criteria (2,016 lines of code, 5.5% vs. main code):
    • 7 *.json files (1,425 lines of code)
    • 9 *.md files (555 lines of code)
    • 3 *.svg files (36 lines of code)
  • " *.json" is biggest, containing 70.68% of code.
  • " *.svg" is smallest, containing 1.79% of code.


*.json1425 LOC (70%) 7 files
*.md555 LOC (27%) 9 files
*.svg36 LOC (1%) 3 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.bash files are analyzed with ShellAnalyzer:
    • 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


2022-01-25 19:48