aws-samples / amazon-keyspaces-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
properties
dockerignore
csproj
mod
in
  • 25 extensions are included in analyses: md, java, txt, sh, ftl, json, gitignore, xml, properties, py, js, cs, dockerignore, yml, ipynb, csproj, mod, sbt, scala, bat, yaml, in, go, gradle, rb
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (9 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (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) (9 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.

main1625 LOC (39%) 34 files
test110 LOC (2%) 5 files
generated0 LOC (0%) 0 files
build and deployment245 LOC (5%) 12 files
other2132 LOC (51%) 52 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 34 files match defined criteria (1,625 lines of code, 100.0% vs. main code):
    • 10 *.java files (481 lines of code)
    • 1 *.yaml files (366 lines of code)
    • 3 *.js files (253 lines of code)
    • 8 *.ftl files (248 lines of code)
    • 2 *.cs files (83 lines of code)
    • 3 *.py files (54 lines of code)
    • 1 *.go files (53 lines of code)
    • 2 *.yml files (43 lines of code)
    • 1 *.rb files (24 lines of code)
    • 1 *.scala files (13 lines of code)
    • 1 *.sbt files (6 lines of code)
    • 1 *.in files (1 lines of code)
  • " *.java" is biggest, containing 29.6% of code.
  • " *.in" is smallest, containing 0.06% of code.


*.java481 LOC (29%) 10 files
*.yaml366 LOC (22%) 1 files
*.js253 LOC (15%) 3 files
*.ftl248 LOC (15%) 8 files
*.cs83 LOC (5%) 2 files
*.py54 LOC (3%) 3 files
*.go53 LOC (3%) 1 files
*.yml43 LOC (2%) 2 files
*.rb24 LOC (1%) 1 files
*.scala13 LOC (<1%) 1 files
*.sbt6 LOC (<1%) 1 files
*.in1 LOC (<1%) 1 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]est/.*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 5 files match defined criteria (110 lines of code, 6.8% vs. main code):
    • 3 *.java files (73 lines of code)
    • 1 *.cs files (21 lines of code)
    • 1 *.csproj files (16 lines of code)
  • " *.java" is biggest, containing 66.36% of code.
  • " *.csproj" is smallest, containing 14.55% of code.


*.java73 LOC (66%) 3 files
*.cs21 LOC (19%) 1 files
*.csproj16 LOC (14%) 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 ".*/pom[.]xml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]csproj".
  • 12 files match defined criteria (245 lines of code, 15.1% vs. main code):
    • 9 *.sh files (114 lines of code)
    • 1 *.bat files (76 lines of code)
    • 1 *.gradle files (34 lines of code)
    • 1 *.csproj files (21 lines of code)
  • " *.sh" is biggest, containing 46.53% of code.
  • " *.csproj" is smallest, containing 8.57% of code.


*.sh114 LOC (46%) 9 files
*.bat76 LOC (31%) 1 files
*.gradle34 LOC (13%) 1 files
*.csproj21 LOC (8%) 1 files
Other Code
properties
mod
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 ".*[.]properties".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 52 files match defined criteria (2,132 lines of code, 131.2% vs. main code):
    • 33 *.md files (1,022 lines of code)
    • 6 *.xml files (473 lines of code)
    • 2 *.ipynb files (441 lines of code)
    • 6 *.json files (105 lines of code)
    • 4 *.properties files (84 lines of code)
    • 1 *.mod files (7 lines of code)
  • " *.md" is biggest, containing 47.94% of code.
  • " *.mod" is smallest, containing 0.33% of code.


*.md1022 LOC (47%) 33 files
*.xml473 LOC (22%) 6 files
*.ipynb441 LOC (20%) 2 files
*.json105 LOC (4%) 6 files
*.properties84 LOC (3%) 4 files
*.mod7 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.ftl 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
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.scala files are analyzed with ScalaAnalyzer:
    • 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
  • *.sbt files are analyzed with ScalaAnalyzer:
    • 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
  • *.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


2022-01-31 16:50