aws-samples / aws-cdk-examples
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
csproj
mod
npmignore
editorconfig
properties
  • 20 extensions are included in analyses: json, py, md, ts, txt, java, cs, gitignore, xml, yml, sh, csproj, js, go, html, mod, npmignore, bat, editorconfig, properties
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (49 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (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 ".*[.]txt" (Text files) (46 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.

main10080 LOC (46%) 275 files
test385 LOC (1%) 12 files
generated0 LOC (0%) 0 files
build and deployment326 LOC (1%) 30 files
other10941 LOC (50%) 397 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 ".*".
  • 275 files match defined criteria (10,080 lines of code, 100.0% vs. main code):
    • 147 *.py files (4,841 lines of code)
    • 62 *.ts files (2,879 lines of code)
    • 27 *.cs files (817 lines of code)
    • 12 *.js files (578 lines of code)
    • 9 *.java files (360 lines of code)
    • 7 *.go files (325 lines of code)
    • 7 *.html files (227 lines of code)
    • 4 *.yml files (53 lines of code)
  • " *.py" is biggest, containing 48.03% of code.
  • " *.yml" is smallest, containing 0.53% of code.


*.py4841 LOC (48%) 147 files
*.ts2879 LOC (28%) 62 files
*.cs817 LOC (8%) 27 files
*.js578 LOC (5%) 12 files
*.java360 LOC (3%) 9 files
*.go325 LOC (3%) 7 files
*.html227 LOC (2%) 7 files
*.yml53 LOC (<1%) 4 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 ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 12 files match defined criteria (385 lines of code, 3.8% vs. main code):
    • 2 *.cs files (108 lines of code)
    • 3 *.py files (107 lines of code)
    • 4 *.go files (77 lines of code)
    • 1 *.ts files (61 lines of code)
    • 2 *.csproj files (32 lines of code)
  • " *.cs" is biggest, containing 28.05% of code.
  • " *.csproj" is smallest, containing 8.31% of code.


*.cs108 LOC (28%) 2 files
*.py107 LOC (27%) 3 files
*.go77 LOC (20%) 4 files
*.ts61 LOC (15%) 1 files
*.csproj32 LOC (8%) 2 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 ".*[.]sh".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]bat".
  • 30 files match defined criteria (326 lines of code, 3.2% vs. main code):
    • 15 *.sh files (158 lines of code)
    • 12 *.csproj files (135 lines of code)
    • 3 *.bat files (33 lines of code)
  • " *.sh" is biggest, containing 48.47% of code.
  • " *.bat" is smallest, containing 10.12% of code.


*.sh158 LOC (48%) 15 files
*.csproj135 LOC (41%) 12 files
*.bat33 LOC (10%) 3 files
Other Code
mod
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 ".*/[.]gitignore".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 397 files match defined criteria (10,941 lines of code, 108.5% vs. main code):
    • 231 *.json files (4,674 lines of code)
    • 102 *.md files (3,458 lines of code)
    • 38 *.java files (1,539 lines of code)
    • 19 *.xml files (1,206 lines of code)
    • 6 *.mod files (54 lines of code)
    • 1 *.properties files (10 lines of code)
  • " *.json" is biggest, containing 42.72% of code.
  • " *.properties" is smallest, containing 0.09% of code.


*.json4674 LOC (42%) 231 files
*.md3458 LOC (31%) 102 files
*.java1539 LOC (14%) 38 files
*.xml1206 LOC (11%) 19 files
*.mod54 LOC (<1%) 6 files
*.properties10 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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)
  • *.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
  • *.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)
  • *.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
  • *.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


2022-01-31 15:49