aws-samples / retail-demo-store
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
mod
webmanifest
dockerignore
srt
  • 19 extensions are included in analyses: vue, py, sh, js, go, yaml, md, txt, ipynb, json, svg, yml, html, gitignore, mod, css, webmanifest, dockerignore, srt
  • 5 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 ".*/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) (21 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.

main49983 LOC (50%) 266 files
test201 LOC (<1%) 5 files
generated17548 LOC (17%) 3 files
build and deployment752 LOC (<1%) 39 files
other30025 LOC (30%) 67 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
srt
webmanifest
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 266 files match defined criteria (49,983 lines of code, 100.0% vs. main code):
    • 33 *.yaml files (29,064 lines of code)
    • 97 *.vue files (8,604 lines of code)
    • 47 *.py files (6,452 lines of code)
    • 33 *.go files (2,601 lines of code)
    • 36 *.js files (2,320 lines of code)
    • 6 *.html files (702 lines of code)
    • 11 *.yml files (209 lines of code)
    • 1 *.css files (18 lines of code)
    • 1 *.srt files (12 lines of code)
    • 1 *.webmanifest files (1 lines of code)
  • " *.yaml" is biggest, containing 58.15% of code.
  • " *.webmanifest" is smallest, containing 0% of code.


*.yaml29064 LOC (58%) 33 files
*.vue8604 LOC (17%) 97 files
*.py6452 LOC (12%) 47 files
*.go2601 LOC (5%) 33 files
*.js2320 LOC (4%) 36 files
*.html702 LOC (1%) 6 files
*.yml209 LOC (<1%) 11 files
*.css18 LOC (<1%) 1 files
*.srt12 LOC (<1%) 1 files
*.webmanifest1 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 ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 5 files match defined criteria (201 lines of code, 0.4% vs. main code). All matches are in *.py files.


*.py201 LOC (100%) 5 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".
  • 3 files match defined criteria (17,548 lines of code, 35.1% vs. main code). All matches are in *.json files.


*.json17548 LOC (100%) 3 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 ".*[.]sh".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 39 files match defined criteria (752 lines of code, 1.5% vs. main code):
    • 38 *.sh files (553 lines of code)
    • 1 *.yml files (199 lines of code)
  • " *.sh" is biggest, containing 73.54% of code.
  • " *.yml" is smallest, containing 26.46% of code.


*.sh553 LOC (73%) 38 files
*.yml199 LOC (26%) 1 files
Other Code
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 67 files match defined criteria (30,025 lines of code, 60.1% vs. main code):
    • 16 *.json files (18,417 lines of code)
    • 17 *.ipynb files (10,369 lines of code)
    • 23 *.md files (912 lines of code)
    • 9 *.svg files (310 lines of code)
    • 2 *.mod files (17 lines of code)
  • " *.json" is biggest, containing 61.34% of code.
  • " *.mod" is smallest, containing 0.06% of code.


*.json18417 LOC (61%) 16 files
*.ipynb10369 LOC (34%) 17 files
*.md912 LOC (3%) 23 files
*.svg310 LOC (1%) 9 files
*.mod17 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
  • *.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
  • *.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
  • *.srt 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
  • *.webmanifest files are analyzed with JsonAnalyzer:
    • 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 16:19