aws / aws-sam-cli-app-templates
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
cfg
txt
csproj
properties
npmignore
mod
eslintignore
  • 25 extensions are included in analyses: py, json, md, java, gitignore, yaml, js, cfg, txt, yml, cs, gradle, csproj, xml, properties, bat, ts, npmignore, go, rb, mod, ipynb, ps1, toml, eslintignore
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (117 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (21 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) (58 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.

main11123 LOC (29%) 524 files
test6838 LOC (17%) 263 files
generated0 LOC (0%) 0 files
build and deployment2028 LOC (5%) 57 files
other18084 LOC (47%) 463 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 524 files match defined criteria (11,123 lines of code, 100.0% vs. main code):
    • 97 *.yaml files (4,556 lines of code)
    • 62 *.java files (2,584 lines of code)
    • 209 *.py files (2,131 lines of code)
    • 16 *.cs files (526 lines of code)
    • 28 *.yml files (446 lines of code)
    • 26 *.js files (332 lines of code)
    • 12 *.ts files (182 lines of code)
    • 5 *.go files (154 lines of code)
    • 61 *.cfg files (122 lines of code)
    • 5 *.rb files (47 lines of code)
    • 2 *.ps1 files (40 lines of code)
    • 1 *.toml files (3 lines of code)
  • " *.yaml" is biggest, containing 40.96% of code.
  • " *.toml" is smallest, containing 0.03% of code.


*.yaml4556 LOC (40%) 97 files
*.java2584 LOC (23%) 62 files
*.py2131 LOC (19%) 209 files
*.cs526 LOC (4%) 16 files
*.yml446 LOC (4%) 28 files
*.js332 LOC (2%) 26 files
*.ts182 LOC (1%) 12 files
*.go154 LOC (1%) 5 files
*.cfg122 LOC (1%) 61 files
*.rb47 LOC (<1%) 5 files
*.ps140 LOC (<1%) 2 files
*.toml3 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.]tests[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*__tests__.*".
    • files with any line of content like ".*/simpletest/.*".
  • 263 files match defined criteria (6,838 lines of code, 61.5% vs. main code):
    • 149 *.py files (3,235 lines of code)
    • 34 *.js files (1,359 lines of code)
    • 42 *.java files (1,043 lines of code)
    • 12 *.cs files (444 lines of code)
    • 5 *.rb files (218 lines of code)
    • 12 *.csproj files (198 lines of code)
    • 5 *.go files (164 lines of code)
    • 3 *.ts files (157 lines of code)
    • 1 *.ps1 files (20 lines of code)
  • " *.py" is biggest, containing 47.31% of code.
  • " *.ps1" is smallest, containing 0.29% of code.


*.py3235 LOC (47%) 149 files
*.js1359 LOC (19%) 34 files
*.java1043 LOC (15%) 42 files
*.cs444 LOC (6%) 12 files
*.rb218 LOC (3%) 5 files
*.csproj198 LOC (2%) 12 files
*.go164 LOC (2%) 5 files
*.ts157 LOC (2%) 3 files
*.ps120 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]csproj".
  • 57 files match defined criteria (2,028 lines of code, 18.2% vs. main code):
    • 20 *.bat files (1,262 lines of code)
    • 25 *.gradle files (625 lines of code)
    • 12 *.csproj files (141 lines of code)
  • " *.bat" is biggest, containing 62.23% of code.
  • " *.csproj" is smallest, containing 6.95% of code.


*.bat1262 LOC (62%) 20 files
*.gradle625 LOC (30%) 25 files
*.csproj141 LOC (6%) 12 files
Other Code
mod
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 ".*/[.]gitignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 463 files match defined criteria (18,084 lines of code, 162.6% vs. main code):
    • 200 *.md files (9,540 lines of code)
    • 233 *.json files (6,437 lines of code)
    • 21 *.xml files (1,060 lines of code)
    • 4 *.ipynb files (1,032 lines of code)
    • 5 *.mod files (15 lines of code)
  • " *.md" is biggest, containing 52.75% of code.
  • " *.mod" is smallest, containing 0.08% of code.


*.md9540 LOC (52%) 200 files
*.json6437 LOC (35%) 233 files
*.xml1060 LOC (5%) 21 files
*.ipynb1032 LOC (5%) 4 files
*.mod15 LOC (<1%) 5 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
  • *.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)
  • *.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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 namespace heuristics)
  • *.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
  • *.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
  • *.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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.rb files are analyzed with RubyAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.ps1 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
  • *.toml 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-01-31 15:09