aws / aws-sam-cli
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
csproj
cfg
npmignore
ini
properties
spec
in
  • 30 extensions are included in analyses: py, yaml, json, txt, md, yml, java, js, gitignore, go, ts, rb, mod, xml, toml, cs, csproj, cfg, gradle, npmignore, bat, sh, ini, properties, spec, ps1, rst, in, kts, Dockerfile
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (25 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (465 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (0 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (1 file).
    • 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) (7 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.

main25960 LOC (22%) 345 files
test81201 LOC (70%) 696 files
generated0 LOC (0%) 0 files
build and deployment188 LOC (<1%) 4 files
other8331 LOC (7%) 124 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
spec
in
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 345 files match defined criteria (25,960 lines of code, 100.0% vs. main code):
    • 310 *.py files (24,114 lines of code)
    • 11 *.yml files (832 lines of code)
    • 8 *.yaml files (604 lines of code)
    • 1 *.ps1 files (141 lines of code)
    • 4 *.java files (106 lines of code)
    • 1 *.go files (37 lines of code)
    • 1 *.cs files (37 lines of code)
    • 1 *.spec files (29 lines of code)
    • 1 *.toml files (19 lines of code)
    • 1 *.js files (15 lines of code)
    • 1 *.in files (9 lines of code)
    • 1 *.rb files (9 lines of code)
    • 4 *.cfg files (8 lines of code)
  • " *.py" is biggest, containing 92.89% of code.
  • " *.cfg" is smallest, containing 0.03% of code.


*.py24114 LOC (92%) 310 files
*.yml832 LOC (3%) 11 files
*.yaml604 LOC (2%) 8 files
*.ps1141 LOC (<1%) 1 files
*.java106 LOC (<1%) 4 files
*.go37 LOC (<1%) 1 files
*.cs37 LOC (<1%) 1 files
*.spec29 LOC (<1%) 1 files
*.toml19 LOC (<1%) 1 files
*.js15 LOC (<1%) 1 files
*.in9 LOC (<1%) 1 files
*.rb9 LOC (<1%) 1 files
*.cfg8 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 ".*/[Tt]ests/.*".
    • 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 ".*_test[.].*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 696 files match defined criteria (81,201 lines of code, 312.8% vs. main code):
    • 333 *.py files (60,059 lines of code)
    • 356 *.yaml files (20,878 lines of code)
    • 1 *.rb files (89 lines of code)
    • 1 *.go files (51 lines of code)
    • 1 *.cs files (49 lines of code)
    • 2 *.java files (38 lines of code)
    • 1 *.csproj files (21 lines of code)
    • 1 *.js files (16 lines of code)
  • " *.py" is biggest, containing 73.96% of code.
  • " *.js" is smallest, containing 0.02% of code.


*.py60059 LOC (73%) 333 files
*.yaml20878 LOC (25%) 356 files
*.rb89 LOC (<1%) 1 files
*.go51 LOC (<1%) 1 files
*.cs49 LOC (<1%) 1 files
*.java38 LOC (<1%) 2 files
*.csproj21 LOC (<1%) 1 files
*.js16 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 ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]gradle".
  • 4 files match defined criteria (188 lines of code, 0.7% vs. main code):
    • 1 *.sh files (101 lines of code)
    • 1 *.bat files (61 lines of code)
    • 1 *.csproj files (16 lines of code)
    • 1 *.gradle files (10 lines of code)
  • " *.sh" is biggest, containing 53.72% of code.
  • " *.gradle" is smallest, containing 5.32% of code.


*.sh101 LOC (53%) 1 files
*.bat61 LOC (32%) 1 files
*.csproj16 LOC (8%) 1 files
*.gradle10 LOC (5%) 1 files
Other Code
ini
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]json".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 124 files match defined criteria (8,331 lines of code, 32.1% vs. main code):
    • 84 *.json files (4,679 lines of code)
    • 35 *.md files (3,335 lines of code)
    • 1 *.rst files (218 lines of code)
    • 2 *.ini files (52 lines of code)
    • 1 *.xml files (45 lines of code)
    • 1 *.mod files (2 lines of code)
  • " *.json" is biggest, containing 56.16% of code.
  • " *.mod" is smallest, containing 0.02% of code.


*.json4679 LOC (56%) 84 files
*.md3335 LOC (40%) 35 files
*.rst218 LOC (2%) 1 files
*.ini52 LOC (<1%) 2 files
*.xml45 LOC (<1%) 1 files
*.mod2 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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)
  • *.spec 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
  • *.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
  • *.in files are analyzed with RustAnalyzer:
    • 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
  • *.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
  • *.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


2022-01-31 09:07