aws-samples / amazon-location-samples
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
plist
properties
pro
txt
npmignore
  • 27 extensions are included in analyses: json, js, xml, md, gitignore, html, swift, css, plist, yml, gradle, py, kt, ts, vue, sql, properties, tsx, bat, sh, pro, txt, yaml, svg, npmignore, jsx, java
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (30 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (3 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (3 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (7 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 ".*/react(-[^.]*)?\.js" (React) (26 files).
    • exclude files with path like ".*[.]txt" (Text files) (2 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (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.

main5702 LOC (<1%) 96 files
test0 LOC (0%) 0 files
generated436106 LOC (48%) 11 files
build and deployment938 LOC (<1%) 17 files
other457117 LOC (50%) 164 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 96 files match defined criteria (5,702 lines of code, 100.0% vs. main code):
    • 9 *.yml files (2,451 lines of code)
    • 30 *.js files (1,190 lines of code)
    • 13 *.html files (456 lines of code)
    • 13 *.swift files (382 lines of code)
    • 2 *.yaml files (312 lines of code)
    • 4 *.tsx files (287 lines of code)
    • 7 *.py files (263 lines of code)
    • 6 *.vue files (167 lines of code)
    • 11 *.css files (141 lines of code)
    • 1 *.jsx files (53 lines of code)
  • " *.yml" is biggest, containing 42.98% of code.
  • " *.jsx" is smallest, containing 0.93% of code.


*.yml2451 LOC (42%) 9 files
*.js1190 LOC (20%) 30 files
*.html456 LOC (7%) 13 files
*.swift382 LOC (6%) 13 files
*.yaml312 LOC (5%) 2 files
*.tsx287 LOC (5%) 4 files
*.py263 LOC (4%) 7 files
*.vue167 LOC (2%) 6 files
*.css141 LOC (2%) 11 files
*.jsx53 LOC (<1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/npm[-]shrinkwrap[.]json".
  • 11 files match defined criteria (436,106 lines of code, 7648.3% vs. main code). All matches are in *.json files.


*.json436106 LOC (100%) 11 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 ".*/package[-]lock[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/pom[.]xml".
  • 17 files match defined criteria (938 lines of code, 16.5% vs. main code):
    • 2 *.js files (546 lines of code)
    • 9 *.gradle files (185 lines of code)
    • 3 *.bat files (183 lines of code)
    • 3 *.sh files (24 lines of code)
  • " *.js" is biggest, containing 58.21% of code.
  • " *.sh" is smallest, containing 2.56% of code.


*.js546 LOC (58%) 2 files
*.gradle185 LOC (19%) 9 files
*.bat183 LOC (19%) 3 files
*.sh24 LOC (2%) 3 files
Other Code
plist
properties
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 ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 164 files match defined criteria (457,117 lines of code, 8016.8% vs. main code):
    • 87 *.json files (453,898 lines of code)
    • 24 *.md files (1,620 lines of code)
    • 25 *.xml files (543 lines of code)
    • 7 *.kt files (432 lines of code)
    • 10 *.plist files (254 lines of code)
    • 6 *.sql files (163 lines of code)
    • 1 *.java files (106 lines of code)
    • 3 *.properties files (63 lines of code)
    • 1 *.svg files (38 lines of code)
  • " *.json" is biggest, containing 99.3% of code.
  • " *.svg" is smallest, containing 0.01% of code.


*.json453898 LOC (99%) 87 files
*.md1620 LOC (<1%) 24 files
*.xml543 LOC (<1%) 25 files
*.kt432 LOC (<1%) 7 files
*.plist254 LOC (<1%) 10 files
*.sql163 LOC (<1%) 6 files
*.java106 LOC (<1%) 1 files
*.properties63 LOC (<1%) 3 files
*.svg38 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.swift files are analyzed with SwiftAnalyzer:
    • 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
  • *.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
  • *.tsx files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.vue 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
  • *.jsx 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


2022-01-31 16:43