aws-samples / aws-last-mile-delivery-hyperlocal
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
t
txt
properties
npmignore
dockerignore
npmrc
cmd
eslintignore
  • 20 extensions are included in analyses: js, ts, json, java, md, tsx, sh, t, txt, gitignore, properties, xml, html, css, yml, npmignore, dockerignore, npmrc, cmd, eslintignore
  • 10 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 ".*\.d\.ts" (Typescript definition files) (2 files).
    • exclude files with path like ".*/prototype(.*)\.js" (Prototype) (39 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (5 files).
    • exclude files with path like ".*/mvnw\.cmd" (Maven) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (16 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) (4 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.

main32488 LOC (80%) 726 files
test596 LOC (1%) 34 files
generated0 LOC (0%) 0 files
build and deployment563 LOC (1%) 14 files
other6917 LOC (17%) 184 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
t
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 726 files match defined criteria (32,488 lines of code, 100.0% vs. main code):
    • 212 *.ts files (14,349 lines of code)
    • 375 *.js files (9,791 lines of code)
    • 45 *.tsx files (3,562 lines of code)
    • 76 *.java files (3,101 lines of code)
    • 3 *.html files (1,440 lines of code)
    • 11 *.t files (159 lines of code)
    • 2 *.yml files (74 lines of code)
    • 2 *.css files (12 lines of code)
  • " *.ts" is biggest, containing 44.17% of code.
  • " *.css" is smallest, containing 0.04% of code.


*.ts14349 LOC (44%) 212 files
*.js9791 LOC (30%) 375 files
*.tsx3562 LOC (10%) 45 files
*.java3101 LOC (9%) 76 files
*.html1440 LOC (4%) 3 files
*.t159 LOC (<1%) 11 files
*.yml74 LOC (<1%) 2 files
*.css12 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
t
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.]spec[.]ts".
    • files with any line of content like ".*/simpletest/.*".
  • 34 files match defined criteria (596 lines of code, 1.8% vs. main code):
    • 32 *.ts files (583 lines of code)
    • 1 *.t files (9 lines of code)
    • 1 *.js files (4 lines of code)
  • " *.ts" is biggest, containing 97.82% of code.
  • " *.js" is smallest, containing 0.67% of code.


*.ts583 LOC (97%) 32 files
*.t9 LOC (1%) 1 files
*.js4 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 ".*/pom[.]xml".
    • files with paths like ".*/[.]mvn/.*".
  • 14 files match defined criteria (563 lines of code, 1.7% vs. main code). All matches are in *.sh files.


*.sh563 LOC (100%) 14 files
Other Code
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 ".*/[.]npmignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 184 files match defined criteria (6,917 lines of code, 21.3% vs. main code):
    • 132 *.json files (5,257 lines of code)
    • 43 *.md files (984 lines of code)
    • 4 *.xml files (354 lines of code)
    • 5 *.properties files (322 lines of code)
  • " *.json" is biggest, containing 76% of code.
  • " *.properties" is smallest, containing 4.66% of code.


*.json5257 LOC (76%) 132 files
*.md984 LOC (14%) 43 files
*.xml354 LOC (5%) 4 files
*.properties322 LOC (4%) 5 files
Analyzers
Info about analyzers used for source code examinations.
  • *.ts 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
  • *.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
  • *.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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.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
  • *.t files are analyzed with PerlAnalyzer:
    • 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
  • *.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
  • *.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


2022-01-31 18:02