aws / aws-parallelcluster-cookbook
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
gitattributes
editorconfig
txt
ini
dockerignore
cfg
csh
  • 17 extensions are included in analyses: rb, md, yml, erb, sh, json, py, gitignore, gitattributes, editorconfig, toml, txt, yaml, ini, dockerignore, cfg, csh
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (97 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 ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (426 files).
    • exclude files with path like ".*[.]txt" (Text files) (5 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.

main7168 LOC (61%) 152 files
test645 LOC (5%) 15 files
generated0 LOC (0%) 0 files
build and deployment2235 LOC (19%) 16 files
other1577 LOC (13%) 11 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
csh
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 152 files match defined criteria (7,168 lines of code, 100.0% vs. main code):
    • 106 *.rb files (4,503 lines of code)
    • 35 *.erb files (1,360 lines of code)
    • 10 *.py files (1,295 lines of code)
    • 1 *.csh files (10 lines of code)
  • " *.rb" is biggest, containing 62.82% of code.
  • " *.csh" is smallest, containing 0.14% of code.


*.rb4503 LOC (62%) 106 files
*.erb1360 LOC (18%) 35 files
*.py1295 LOC (18%) 10 files
*.csh10 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 ".*[-]tests[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 15 files match defined criteria (645 lines of code, 9.0% vs. main code):
    • 4 *.py files (309 lines of code)
    • 8 *.rb files (232 lines of code)
    • 1 *.yaml files (77 lines of code)
    • 2 *.sh files (27 lines of code)
  • " *.py" is biggest, containing 47.91% of code.
  • " *.sh" is smallest, containing 4.19% of code.


*.py309 LOC (47%) 4 files
*.rb232 LOC (35%) 8 files
*.yaml77 LOC (11%) 1 files
*.sh27 LOC (4%) 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 ".*/[.]gitattributes".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitignore".
  • 16 files match defined criteria (2,235 lines of code, 31.2% vs. main code). All matches are in *.sh files.


*.sh2235 LOC (100%) 16 files
Other Code
ini
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 ".*[.]ini".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 11 files match defined criteria (1,577 lines of code, 22.0% vs. main code):
    • 5 *.md files (750 lines of code)
    • 5 *.json files (661 lines of code)
    • 1 *.ini files (166 lines of code)
  • " *.md" is biggest, containing 47.56% of code.
  • " *.ini" is smallest, containing 10.53% of code.


*.md750 LOC (47%) 5 files
*.json661 LOC (41%) 5 files
*.ini166 LOC (10%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.rb files are analyzed with RubyAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.erb 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
  • *.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
  • *.csh 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


2022-01-31 04:01