aws-samples / multi-environment-chatops-bot-for-controltower
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
  • 9 extensions are included in analyses: java, yml, xml, md, sh, json, txt, py, yaml
  • 5 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 ".*/target/.*" (Compiled files) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (0 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.

main2033 LOC (72%) 14 files
test114 LOC (4%) 3 files
generated0 LOC (0%) 0 files
build and deployment179 LOC (6%) 2 files
other496 LOC (17%) 8 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 ".*".
  • 14 files match defined criteria (2,033 lines of code, 100.0% vs. main code):
    • 6 *.yml files (1,291 lines of code)
    • 6 *.java files (655 lines of code)
    • 1 *.yaml files (69 lines of code)
    • 1 *.py files (18 lines of code)
  • " *.yml" is biggest, containing 63.5% of code.
  • " *.py" is smallest, containing 0.89% of code.


*.yml1291 LOC (63%) 6 files
*.java655 LOC (32%) 6 files
*.yaml69 LOC (3%) 1 files
*.py18 LOC (<1%) 1 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 ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 3 files match defined criteria (114 lines of code, 5.6% vs. main code):
    • 2 *.java files (82 lines of code)
    • 1 *.yml files (32 lines of code)
  • " *.java" is biggest, containing 71.93% of code.
  • " *.yml" is smallest, containing 28.07% of code.


*.java82 LOC (71%) 2 files
*.yml32 LOC (28%) 1 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 ".*/pom[.]xml".
    • files with paths like ".*[.]sh".
  • 2 files match defined criteria (179 lines of code, 8.8% vs. main code). All matches are in *.sh files.


*.sh179 LOC (100%) 2 files
Other Code
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 ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 8 files match defined criteria (496 lines of code, 24.4% vs. main code):
    • 4 *.xml files (337 lines of code)
    • 1 *.json files (88 lines of code)
    • 3 *.md files (71 lines of code)
  • " *.xml" is biggest, containing 67.94% of code.
  • " *.md" is smallest, containing 14.31% of code.


*.xml337 LOC (67%) 4 files
*.json88 LOC (17%) 1 files
*.md71 LOC (14%) 3 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)
  • *.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
  • *.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


2022-01-31 17:34