awslabs / aws-crt-nodejs
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
npmignore
clang-format
gitmodules
  • 17 extensions are included in analyses: html, ts, json, c, h, js, sh, yml, md, css, txt, npmignore, gitignore, clang-format, py, bat, gitmodules
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (95 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) (1 file).
    • 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.

main8617 LOC (21%) 67 files
test1297 LOC (3%) 17 files
generated14142 LOC (35%) 4 files
build and deployment114 LOC (<1%) 11 files
other15274 LOC (38%) 28 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 ".*".
  • 67 files match defined criteria (8,617 lines of code, 100.0% vs. main code):
    • 14 *.c files (5,879 lines of code)
    • 30 *.ts files (2,163 lines of code)
    • 14 *.h files (295 lines of code)
    • 4 *.js files (207 lines of code)
    • 5 *.yml files (73 lines of code)
  • " *.c" is biggest, containing 68.23% of code.
  • " *.yml" is smallest, containing 0.85% of code.


*.c5879 LOC (68%) 14 files
*.ts2163 LOC (25%) 30 files
*.h295 LOC (3%) 14 files
*.js207 LOC (2%) 4 files
*.yml73 LOC (<1%) 5 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 ".*[.]spec[.]ts".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 17 files match defined criteria (1,297 lines of code, 15.1% vs. main code):
    • 13 *.ts files (1,225 lines of code)
    • 4 *.js files (72 lines of code)
  • " *.ts" is biggest, containing 94.45% of code.
  • " *.js" is smallest, containing 5.55% of code.


*.ts1225 LOC (94%) 13 files
*.js72 LOC (5%) 4 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".
  • 4 files match defined criteria (14,142 lines of code, 164.1% vs. main code). All matches are in *.json files.


*.json14142 LOC (100%) 4 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 ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*[.]bat".
  • 11 files match defined criteria (114 lines of code, 1.3% vs. main code):
    • 10 *.sh files (110 lines of code)
    • 1 *.bat files (4 lines of code)
  • " *.sh" is biggest, containing 96.49% of code.
  • " *.bat" is smallest, containing 3.51% of code.


*.sh110 LOC (96%) 10 files
*.bat4 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 ".*/[.]npmignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ss]amples/.*".
  • 28 files match defined criteria (15,274 lines of code, 177.3% vs. main code):
    • 17 *.json files (14,726 lines of code)
    • 4 *.ts files (415 lines of code)
    • 3 *.md files (79 lines of code)
    • 2 *.js files (36 lines of code)
    • 2 *.html files (18 lines of code)
  • " *.json" is biggest, containing 96.41% of code.
  • " *.html" is smallest, containing 0.12% of code.


*.json14726 LOC (96%) 17 files
*.ts415 LOC (2%) 4 files
*.md79 LOC (<1%) 3 files
*.js36 LOC (<1%) 2 files
*.html18 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.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
  • *.h files are analyzed with CppAnalyzer:
    • 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
  • *.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 18:28