awslabs / aws-crt-python
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
in
cfg
clang-format
gitmodules
clang-tidy
  • 19 extensions are included in analyses: py, c, yml, js, html, h, txt, rst, sh, bat, md, css, json, in, cfg, gitignore, clang-format, gitmodules, clang-tidy
  • 8 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 ".*/docs/.*" (Documentation) (26 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (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) (0 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.

main8170 LOC (73%) 61 files
test2592 LOC (23%) 23 files
generated0 LOC (0%) 0 files
build and deployment139 LOC (1%) 11 files
other184 LOC (1%) 13 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 61 files match defined criteria (8,170 lines of code, 100.0% vs. main code):
    • 21 *.c files (5,438 lines of code)
    • 20 *.py files (2,317 lines of code)
    • 11 *.h files (225 lines of code)
    • 7 *.yml files (171 lines of code)
    • 1 *.in files (16 lines of code)
    • 1 *.cfg files (3 lines of code)
  • " *.c" is biggest, containing 66.56% of code.
  • " *.cfg" is smallest, containing 0.04% of code.


*.c5438 LOC (66%) 21 files
*.py2317 LOC (28%) 20 files
*.h225 LOC (2%) 11 files
*.yml171 LOC (2%) 7 files
*.in16 LOC (<1%) 1 files
*.cfg3 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]est/.*".
    • files with paths like ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 23 files match defined criteria (2,592 lines of code, 31.7% vs. main code):
    • 18 *.py files (2,523 lines of code)
    • 3 *.yml files (57 lines of code)
    • 1 *.bat files (8 lines of code)
    • 1 *.sh files (4 lines of code)
  • " *.py" is biggest, containing 97.34% of code.
  • " *.sh" is smallest, containing 0.15% of code.


*.py2523 LOC (97%) 18 files
*.yml57 LOC (2%) 3 files
*.bat8 LOC (<1%) 1 files
*.sh4 LOC (<1%) 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]bat".
  • 11 files match defined criteria (139 lines of code, 1.7% vs. main code):
    • 8 *.sh files (92 lines of code)
    • 3 *.bat files (47 lines of code)
  • " *.sh" is biggest, containing 66.19% of code.
  • " *.bat" is smallest, containing 33.81% of code.


*.sh92 LOC (66%) 8 files
*.bat47 LOC (33%) 3 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 ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
  • 13 files match defined criteria (184 lines of code, 2.3% vs. main code):
    • 3 *.md files (101 lines of code)
    • 9 *.rst files (59 lines of code)
    • 1 *.json files (24 lines of code)
  • " *.md" is biggest, containing 54.89% of code.
  • " *.json" is smallest, containing 13.04% of code.


*.md101 LOC (54%) 3 files
*.rst59 LOC (32%) 9 files
*.json24 LOC (13%) 1 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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:27