aws-samples / aws-cdk-healthlake-knowledge-analyzer
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
  • 15 extensions are included in analyses: py, jsx, txt, json, js, md, css, gitignore, rst, svg, less, bat, sh, ipynb, html
  • 5 criteria are used to exclude files from analysis:
    • 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) (8 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.

main28140 LOC (24%) 161 files
test905 LOC (<1%) 8 files
generated42302 LOC (36%) 1 files
build and deployment12 LOC (<1%) 2 files
other43096 LOC (37%) 13 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 ".*".
  • 161 files match defined criteria (28,140 lines of code, 100.0% vs. main code):
    • 134 *.py files (25,942 lines of code)
    • 19 *.jsx files (1,650 lines of code)
    • 6 *.js files (516 lines of code)
    • 1 *.html files (20 lines of code)
    • 1 *.css files (12 lines of code)
  • " *.py" is biggest, containing 92.19% of code.
  • " *.css" is smallest, containing 0.04% of code.


*.py25942 LOC (92%) 134 files
*.jsx1650 LOC (5%) 19 files
*.js516 LOC (1%) 6 files
*.html20 LOC (<1%) 1 files
*.css12 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]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 8 files match defined criteria (905 lines of code, 3.2% vs. main code):
    • 7 *.py files (897 lines of code)
    • 1 *.jsx files (8 lines of code)
  • " *.py" is biggest, containing 99.12% of code.
  • " *.jsx" is smallest, containing 0.88% of code.


*.py897 LOC (99%) 7 files
*.jsx8 LOC (<1%) 1 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".
  • 1 file matches defined criteria (42,302 lines of code, 150.3% vs. main code). All matches are in *.json files.


*.json42302 LOC (100%) 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 ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
  • 2 files match defined criteria (12 lines of code, 0.0% vs. main code):
    • 1 *.bat files (11 lines of code)
    • 1 *.sh files (1 lines of code)
  • " *.bat" is biggest, containing 91.67% of code.
  • " *.sh" is smallest, containing 8.33% of code.


*.bat11 LOC (91%) 1 files
*.sh1 LOC (8%) 1 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 ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 13 files match defined criteria (43,096 lines of code, 153.1% vs. main code):
    • 5 *.json files (42,388 lines of code)
    • 1 *.ipynb files (277 lines of code)
    • 5 *.md files (230 lines of code)
    • 2 *.rst files (201 lines of code)
  • " *.json" is biggest, containing 98.36% of code.
  • " *.rst" is smallest, containing 0.47% of code.


*.json42388 LOC (98%) 5 files
*.ipynb277 LOC (<1%) 1 files
*.md230 LOC (<1%) 5 files
*.rst201 LOC (<1%) 2 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
  • *.jsx 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
  • *.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
  • *.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
  • *.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


2022-01-31 17:06