facebookincubator / OSM-HOT-Tasking-Manager
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
ini
dockerignore
mako
watchmanconfig
kml
geojson
  • 20 extensions are included in analyses: js, py, json, md, sh, scss, txt, yml, sql, svg, xml, html, ipynb, ini, dockerignore, mako, watchmanconfig, kml, gitignore, geojson
  • 2 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (13 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.

main49336 LOC (46%) 611 files
test12523 LOC (11%) 211 files
generated0 LOC (0%) 0 files
build and deployment429 LOC (<1%) 11 files
other44913 LOC (41%) 68 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
mako
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 611 files match defined criteria (49,336 lines of code, 100.0% vs. main code):
    • 392 *.js files (31,380 lines of code)
    • 196 *.py files (16,683 lines of code)
    • 10 *.scss files (586 lines of code)
    • 5 *.sql files (345 lines of code)
    • 4 *.html files (174 lines of code)
    • 1 *.ipynb files (104 lines of code)
    • 2 *.yml files (47 lines of code)
    • 1 *.mako files (17 lines of code)
  • " *.js" is biggest, containing 63.6% of code.
  • " *.mako" is smallest, containing 0.03% of code.


*.js31380 LOC (63%) 392 files
*.py16683 LOC (33%) 196 files
*.scss586 LOC (1%) 10 files
*.sql345 LOC (<1%) 5 files
*.html174 LOC (<1%) 4 files
*.ipynb104 LOC (<1%) 1 files
*.yml47 LOC (<1%) 2 files
*.mako17 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
geojson
kml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/test_.*".
  • 211 files match defined criteria (12,523 lines of code, 25.4% vs. main code):
    • 154 *.js files (10,474 lines of code)
    • 51 *.py files (1,967 lines of code)
    • 4 *.xml files (80 lines of code)
    • 1 *.geojson files (1 lines of code)
    • 1 *.kml files (1 lines of code)
  • " *.js" is biggest, containing 83.64% of code.
  • " *.kml" is smallest, containing 0.01% of code.


*.js10474 LOC (83%) 154 files
*.py1967 LOC (15%) 51 files
*.xml80 LOC (<1%) 4 files
*.geojson1 LOC (<1%) 1 files
*.kml1 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 ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/docker[-]compose[.]yml".
  • 11 files match defined criteria (429 lines of code, 0.9% vs. main code):
    • 10 *.sh files (376 lines of code)
    • 1 *.yml files (53 lines of code)
  • " *.sh" is biggest, containing 87.65% of code.
  • " *.yml" is smallest, containing 12.35% of code.


*.sh376 LOC (87%) 10 files
*.yml53 LOC (12%) 1 files
Other Code
ini
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 68 files match defined criteria (44,913 lines of code, 91.0% vs. main code):
    • 50 *.json files (44,197 lines of code)
    • 4 *.svg files (298 lines of code)
    • 2 *.ini files (215 lines of code)
    • 7 *.txt files (119 lines of code)
    • 5 *.md files (84 lines of code)
  • " *.json" is biggest, containing 98.41% of code.
  • " *.md" is smallest, containing 0.19% of code.


*.json44197 LOC (98%) 50 files
*.svg298 LOC (<1%) 4 files
*.ini215 LOC (<1%) 2 files
*.txt119 LOC (<1%) 7 files
*.md84 LOC (<1%) 5 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.sql files are analyzed with SqlAnalyzer:
    • 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
  • *.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
  • *.ipynb 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
  • *.mako 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


2022-04-15 05:04