mapillary / OpenSfM
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
pyi
cmake
dockerignore
cfg
clang-format
gitmodules
  • 23 extensions are included in analyses: py, h, cc, js, c, rst, txt, json, pyi, md, html, css, cpp, cmake, sh, yaml, bat, yml, dockerignore, cfg, gitignore, clang-format, gitmodules
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (7 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (6 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (88 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.

main39392 LOC (76%) 289 files
test5886 LOC (11%) 42 files
generated0 LOC (0%) 0 files
build and deployment66 LOC (<1%) 2 files
other5951 LOC (11%) 43 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
pyi
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 289 files match defined criteria (39,392 lines of code, 100.0% vs. main code):
    • 112 *.py files (17,338 lines of code)
    • 41 *.cc files (6,547 lines of code)
    • 69 *.h files (6,290 lines of code)
    • 39 *.js files (4,610 lines of code)
    • 7 *.html files (1,447 lines of code)
    • 4 *.cmake files (1,381 lines of code)
    • 8 *.pyi files (1,366 lines of code)
    • 5 *.css files (317 lines of code)
    • 3 *.yaml files (88 lines of code)
    • 1 *.cfg files (8 lines of code)
  • " *.py" is biggest, containing 44.01% of code.
  • " *.cfg" is smallest, containing 0.02% of code.


*.py17338 LOC (44%) 112 files
*.cc6547 LOC (16%) 41 files
*.h6290 LOC (15%) 69 files
*.js4610 LOC (11%) 39 files
*.html1447 LOC (3%) 7 files
*.cmake1381 LOC (3%) 4 files
*.pyi1366 LOC (3%) 8 files
*.css317 LOC (<1%) 5 files
*.yaml88 LOC (<1%) 3 files
*.cfg8 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]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
  • 42 files match defined criteria (5,886 lines of code, 14.9% vs. main code):
    • 28 *.py files (3,733 lines of code)
    • 14 *.cc files (2,153 lines of code)
  • " *.py" is biggest, containing 63.42% of code.
  • " *.cc" is smallest, containing 36.58% of code.


*.py3733 LOC (63%) 28 files
*.cc2153 LOC (36%) 14 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 ".*/[.]gitmodules".
    • files with paths like ".*/[.]gitignore".
  • 2 files match defined criteria (66 lines of code, 0.2% vs. main code). All matches are in *.sh files.


*.sh66 LOC (100%) 2 files
Other Code
txt
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 ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
  • 43 files match defined criteria (5,951 lines of code, 15.1% vs. main code):
    • 7 *.json files (3,900 lines of code)
    • 17 *.rst files (1,272 lines of code)
    • 13 *.txt files (520 lines of code)
    • 6 *.md files (259 lines of code)
  • " *.json" is biggest, containing 65.54% of code.
  • " *.md" is smallest, containing 4.35% of code.


*.json3900 LOC (65%) 7 files
*.rst1272 LOC (21%) 17 files
*.txt520 LOC (8%) 13 files
*.md259 LOC (4%) 6 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
  • *.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
  • *.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
  • *.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
  • *.pyi 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
  • *.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
  • *.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-04-16 07:03