aws-samples / amazon-resilient-fix-engine-demo
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
  • 10 extensions are included in analyses: sh, cfg, java, md, gradle, json, txt, xml, yml, sql
  • 4 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 ".*[.]txt" (Text files) (1 file).
    • 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.

main8777 LOC (59%) 9 files
test351 LOC (2%) 6 files
generated0 LOC (0%) 0 files
build and deployment49 LOC (<1%) 7 files
other5660 LOC (38%) 8 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 ".*".
  • 9 files match defined criteria (8,777 lines of code, 100.0% vs. main code):
    • 2 *.yml files (7,649 lines of code)
    • 3 *.java files (1,041 lines of code)
    • 4 *.cfg files (87 lines of code)
  • " *.yml" is biggest, containing 87.15% of code.
  • " *.cfg" is smallest, containing 0.99% of code.


*.yml7649 LOC (87%) 2 files
*.java1041 LOC (11%) 3 files
*.cfg87 LOC (<1%) 4 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 6 files match defined criteria (351 lines of code, 4.0% vs. main code):
    • 2 *.java files (334 lines of code)
    • 2 *.cfg files (15 lines of code)
    • 2 *.sh files (2 lines of code)
  • " *.java" is biggest, containing 95.16% of code.
  • " *.sh" is smallest, containing 0.57% of code.


*.java334 LOC (95%) 2 files
*.cfg15 LOC (4%) 2 files
*.sh2 LOC (<1%) 2 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 ".*[.]gradle".
  • 7 files match defined criteria (49 lines of code, 0.6% vs. main code):
    • 4 *.sh files (25 lines of code)
    • 3 *.gradle files (24 lines of code)
  • " *.sh" is biggest, containing 51.02% of code.
  • " *.gradle" is smallest, containing 48.98% of code.


*.sh25 LOC (51%) 4 files
*.gradle24 LOC (48%) 3 files
Other Code
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 ".*[.]json".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 8 files match defined criteria (5,660 lines of code, 64.5% vs. main code):
    • 2 *.xml files (5,326 lines of code)
    • 5 *.md files (234 lines of code)
    • 1 *.sql files (100 lines of code)
  • " *.xml" is biggest, containing 94.1% of code.
  • " *.sql" is smallest, containing 1.77% of code.


*.xml5326 LOC (94%) 2 files
*.md234 LOC (4%) 5 files
*.sql100 LOC (1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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)
  • *.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 16:43