awslabs / smithy-rs
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
npmignore
hb
  • 19 extensions are included in analyses: json, rs, kt, md, toml, gitignore, kts, ts, txt, sh, py, yaml, properties, npmignore, js, bat, yml, gradle, hb
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (32 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (2 files).
    • exclude files with path like ".*/cache/.*" (Caches) (0 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) (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.

main51836 LOC (16%) 433 files
test8967 LOC (2%) 116 files
generated44623 LOC (14%) 2 files
build and deployment258 LOC (<1%) 9 files
other205207 LOC (66%) 213 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
hb
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 433 files match defined criteria (51,836 lines of code, 100.0% vs. main code):
    • 225 *.rs files (32,196 lines of code)
    • 150 *.kt files (17,095 lines of code)
    • 12 *.kts files (1,001 lines of code)
    • 35 *.toml files (943 lines of code)
    • 4 *.py files (280 lines of code)
    • 5 *.ts files (239 lines of code)
    • 1 *.hb files (74 lines of code)
    • 1 *.js files (8 lines of code)
  • " *.rs" is biggest, containing 62.11% of code.
  • " *.js" is smallest, containing 0.02% of code.


*.rs32196 LOC (62%) 225 files
*.kt17095 LOC (32%) 150 files
*.kts1001 LOC (1%) 12 files
*.toml943 LOC (1%) 35 files
*.py280 LOC (<1%) 4 files
*.ts239 LOC (<1%) 5 files
*.hb74 LOC (<1%) 1 files
*.js8 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 paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/test[-]data/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 116 files match defined criteria (8,967 lines of code, 17.3% vs. main code):
    • 63 *.kt files (5,965 lines of code)
    • 35 *.rs files (2,654 lines of code)
    • 13 *.toml files (230 lines of code)
    • 4 *.ts files (110 lines of code)
    • 1 *.js files (8 lines of code)
  • " *.kt" is biggest, containing 66.52% of code.
  • " *.js" is smallest, containing 0.09% of code.


*.kt5965 LOC (66%) 63 files
*.rs2654 LOC (29%) 35 files
*.toml230 LOC (2%) 13 files
*.ts110 LOC (1%) 4 files
*.js8 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".
  • 2 files match defined criteria (44,623 lines of code, 86.1% vs. main code). All matches are in *.json files.


*.json44623 LOC (100%) 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*[.]bat".
  • 9 files match defined criteria (258 lines of code, 0.5% vs. main code):
    • 7 *.sh files (144 lines of code)
    • 1 *.bat files (61 lines of code)
    • 1 *.gradle files (53 lines of code)
  • " *.sh" is biggest, containing 55.81% of code.
  • " *.gradle" is smallest, containing 20.54% of code.


*.sh144 LOC (55%) 7 files
*.bat61 LOC (23%) 1 files
*.gradle53 LOC (20%) 1 files
Other Code
properties
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 ".*/[.]gitignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
  • 213 files match defined criteria (205,207 lines of code, 395.9% vs. main code):
    • 145 *.json files (201,495 lines of code)
    • 65 *.md files (3,637 lines of code)
    • 2 *.properties files (63 lines of code)
    • 1 *.rs files (12 lines of code)
  • " *.json" is biggest, containing 98.19% of code.
  • " *.rs" is smallest, containing 0.01% of code.


*.json201495 LOC (98%) 145 files
*.md3637 LOC (1%) 65 files
*.properties63 LOC (<1%) 2 files
*.rs12 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.rs 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
  • *.kt files are analyzed with KotlinAnalyzer:
    • 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 (based on imports and package statements)
  • *.kts files are analyzed with KotlinAnalyzer:
    • 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 (based on imports and package statements)
  • *.toml 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
  • *.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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.hb 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
  • *.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


2022-01-31 19:33