aws-samples / aws-fault-injection-simulator-workshop
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
npmignore
txt
mod
gitattributes
editorconfig
  • 20 extensions are included in analyses: md, json, html, sh, js, ts, yaml, css, gitignore, toml, py, npmignore, svg, go, txt, yml, mod, php, gitattributes, editorconfig
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (31 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 "(?i).*/jquery.*[.]js" (jQuery files) (1 file).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (7 files).
    • exclude files with path like ".*[.]txt" (Text files) (3 files).
    • exclude files with path like ".*/static/js/.*" (JS library) (4 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.

main7718 LOC (3%) 98 files
test761 LOC (<1%) 13 files
generated96369 LOC (45%) 7 files
build and deployment675 LOC (<1%) 29 files
other106998 LOC (50%) 178 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 ".*".
  • 98 files match defined criteria (7,718 lines of code, 100.0% vs. main code):
    • 14 *.css files (3,480 lines of code)
    • 13 *.yaml files (1,552 lines of code)
    • 4 *.go files (835 lines of code)
    • 32 *.html files (755 lines of code)
    • 6 *.ts files (344 lines of code)
    • 15 *.toml files (329 lines of code)
    • 4 *.py files (327 lines of code)
    • 7 *.js files (54 lines of code)
    • 1 *.yml files (27 lines of code)
    • 2 *.php files (15 lines of code)
  • " *.css" is biggest, containing 45.09% of code.
  • " *.php" is smallest, containing 0.19% of code.


*.css3480 LOC (45%) 14 files
*.yaml1552 LOC (20%) 13 files
*.go835 LOC (10%) 4 files
*.html755 LOC (9%) 32 files
*.ts344 LOC (4%) 6 files
*.toml329 LOC (4%) 15 files
*.py327 LOC (4%) 4 files
*.js54 LOC (<1%) 7 files
*.yml27 LOC (<1%) 1 files
*.php15 LOC (<1%) 2 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 ".*/test_.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 13 files match defined criteria (761 lines of code, 9.9% vs. main code):
    • 6 *.py files (420 lines of code)
    • 7 *.ts files (341 lines of code)
  • " *.py" is biggest, containing 55.19% of code.
  • " *.ts" is smallest, containing 44.81% of code.


*.py420 LOC (55%) 6 files
*.ts341 LOC (44%) 7 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".
  • 7 files match defined criteria (96,369 lines of code, 1248.6% vs. main code). All matches are in *.json files.


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


*.sh675 LOC (100%) 29 files
Other Code
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/go[.]mod".
  • 178 files match defined criteria (106,998 lines of code, 1386.3% vs. main code):
    • 43 *.json files (97,612 lines of code)
    • 126 *.md files (6,077 lines of code)
    • 7 *.svg files (3,293 lines of code)
    • 2 *.mod files (16 lines of code)
  • " *.json" is biggest, containing 91.23% of code.
  • " *.mod" is smallest, containing 0.01% of code.


*.json97612 LOC (91%) 43 files
*.md6077 LOC (5%) 126 files
*.svg3293 LOC (3%) 7 files
*.mod16 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.php files are analyzed with PhpAnalyzer:
    • 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


2022-01-31 17:09