aws-samples / amazon-aurora-call-to-amazon-sagemaker-sample
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
  • 12 extensions are included in analyses: py, sql, sh, yaml, txt, json, md, ipynb, xml, gitignore, bat, yml
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (2 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (2 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 ".*[.]txt" (Text files) (15 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.

main68063 LOC (79%) 276 files
test10676 LOC (12%) 21 files
generated3130 LOC (3%) 27 files
build and deployment298 LOC (<1%) 24 files
other3926 LOC (4%) 49 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 ".*".
  • 276 files match defined criteria (68,063 lines of code, 100.0% vs. main code):
    • 256 *.py files (66,295 lines of code)
    • 19 *.yaml files (1,758 lines of code)
    • 1 *.yml files (10 lines of code)
  • " *.py" is biggest, containing 97.4% of code.
  • " *.yml" is smallest, containing 0.01% of code.


*.py66295 LOC (97%) 256 files
*.yaml1758 LOC (2%) 19 files
*.yml10 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 ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 21 files match defined criteria (10,676 lines of code, 15.7% vs. main code). All matches are in *.py files.


*.py10676 LOC (100%) 21 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 ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
  • 27 files match defined criteria (3,130 lines of code, 4.6% vs. main code). All matches are in *.py files.


*.py3130 LOC (100%) 27 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 ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 24 files match defined criteria (298 lines of code, 0.4% vs. main code):
    • 23 *.sh files (287 lines of code)
    • 1 *.bat files (11 lines of code)
  • " *.sh" is biggest, containing 96.31% of code.
  • " *.bat" is smallest, containing 3.69% of code.


*.sh287 LOC (96%) 23 files
*.bat11 LOC (3%) 1 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 ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 49 files match defined criteria (3,926 lines of code, 5.8% vs. main code):
    • 2 *.ipynb files (1,908 lines of code)
    • 10 *.json files (737 lines of code)
    • 27 *.sql files (696 lines of code)
    • 7 *.md files (466 lines of code)
    • 3 *.xml files (119 lines of code)
  • " *.ipynb" is biggest, containing 48.6% of code.
  • " *.xml" is smallest, containing 3.03% of code.


*.ipynb1908 LOC (48%) 2 files
*.json737 LOC (18%) 10 files
*.sql696 LOC (17%) 27 files
*.md466 LOC (11%) 7 files
*.xml119 LOC (3%) 3 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
  • *.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
  • *.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


2022-01-31 16:23