aws-samples / aws-saas-factory-eks-reference-architecture
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
properties
editorconfig
txt
  • 17 extensions are included in analyses: ts, java, html, json, scss, yaml, sh, md, gitignore, properties, js, xml, svg, editorconfig, py, txt, yml
  • 7 criteria are used to exclude files from analysis:
    • 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 ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 files).
    • exclude files with path like ".*/[Vv]endors?/.*" (Dependencies) (4 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (2 files).
    • exclude files with path like ".*[.]txt" (Text files) (0 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.

main10053 LOC (74%) 233 files
test417 LOC (3%) 14 files
generated3 LOC (<1%) 1 files
build and deployment565 LOC (4%) 14 files
other2373 LOC (17%) 51 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 ".*".
  • 233 files match defined criteria (10,053 lines of code, 100.0% vs. main code):
    • 65 *.java files (3,607 lines of code)
    • 100 *.ts files (2,682 lines of code)
    • 34 *.html files (1,518 lines of code)
    • 18 *.yaml files (1,419 lines of code)
    • 14 *.scss files (415 lines of code)
    • 1 *.py files (364 lines of code)
    • 1 *.yml files (48 lines of code)
  • " *.java" is biggest, containing 35.88% of code.
  • " *.yml" is smallest, containing 0.48% of code.


*.java3607 LOC (35%) 65 files
*.ts2682 LOC (26%) 100 files
*.html1518 LOC (15%) 34 files
*.yaml1419 LOC (14%) 18 files
*.scss415 LOC (4%) 14 files
*.py364 LOC (3%) 1 files
*.yml48 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 ".*[.]spec[.]ts".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/protractor[.]conf[.]js".
    • files with paths like ".*/karma[.]conf[.]js".
    • files with any line of content like ".*/simpletest/.*".
  • 14 files match defined criteria (417 lines of code, 4.1% vs. main code):
    • 8 *.ts files (225 lines of code)
    • 6 *.js files (192 lines of code)
  • " *.ts" is biggest, containing 53.96% of code.
  • " *.js" is smallest, containing 46.04% of code.


*.ts225 LOC (53%) 8 files
*.js192 LOC (46%) 6 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".
  • 1 file matches defined criteria (3 lines of code, 0.0% vs. main code). All matches are in *.json files.


*.json3 LOC (100%) 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 14 files match defined criteria (565 lines of code, 5.6% vs. main code). All matches are in *.sh files.


*.sh565 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 ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 51 files match defined criteria (2,373 lines of code, 23.6% vs. main code):
    • 27 *.json files (1,570 lines of code)
    • 5 *.xml files (438 lines of code)
    • 12 *.md files (358 lines of code)
    • 7 *.properties files (7 lines of code)
  • " *.json" is biggest, containing 66.16% of code.
  • " *.properties" is smallest, containing 0.29% of code.


*.json1570 LOC (66%) 27 files
*.xml438 LOC (18%) 5 files
*.md358 LOC (15%) 12 files
*.properties7 LOC (<1%) 7 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-31 16:44