aws / aws-nitro-enclaves-cli
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
spec
gitattributes
txt
hbs
  • 16 extensions are included in analyses: rs, md, toml, sh, h, c, py, spec, yml, yaml, gitignore, gitattributes, txt, hbs, json, html
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (1 file).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (3 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (6 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.

main16528 LOC (82%) 52 files
test2288 LOC (11%) 9 files
generated0 LOC (0%) 0 files
build and deployment96 LOC (<1%) 3 files
other1010 LOC (5%) 15 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
spec
hbs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 52 files match defined criteria (16,528 lines of code, 100.0% vs. main code):
    • 30 *.rs files (9,115 lines of code)
    • 1 *.html files (5,030 lines of code)
    • 2 *.c files (1,422 lines of code)
    • 3 *.spec files (455 lines of code)
    • 4 *.h files (224 lines of code)
    • 7 *.toml files (139 lines of code)
    • 1 *.hbs files (65 lines of code)
    • 2 *.yaml files (54 lines of code)
    • 2 *.yml files (24 lines of code)
  • " *.rs" is biggest, containing 55.15% of code.
  • " *.yml" is smallest, containing 0.15% of code.


*.rs9115 LOC (55%) 30 files
*.html5030 LOC (30%) 1 files
*.c1422 LOC (8%) 2 files
*.spec455 LOC (2%) 3 files
*.h224 LOC (1%) 4 files
*.toml139 LOC (<1%) 7 files
*.hbs65 LOC (<1%) 1 files
*.yaml54 LOC (<1%) 2 files
*.yml24 LOC (<1%) 2 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 ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 9 files match defined criteria (2,288 lines of code, 13.8% vs. main code):
    • 4 *.rs files (1,847 lines of code)
    • 3 *.py files (302 lines of code)
    • 1 *.sh files (82 lines of code)
    • 1 *.c files (57 lines of code)
  • " *.rs" is biggest, containing 80.73% of code.
  • " *.c" is smallest, containing 2.49% of code.


*.rs1847 LOC (80%) 4 files
*.py302 LOC (13%) 3 files
*.sh82 LOC (3%) 1 files
*.c57 LOC (2%) 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
  • 3 files match defined criteria (96 lines of code, 0.6% vs. main code). All matches are in *.sh files.


*.sh96 LOC (100%) 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 ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
  • 15 files match defined criteria (1,010 lines of code, 6.1% vs. main code):
    • 5 *.rs files (622 lines of code)
    • 7 *.md files (359 lines of code)
    • 1 *.toml files (17 lines of code)
    • 2 *.sh files (12 lines of code)
  • " *.rs" is biggest, containing 61.58% of code.
  • " *.sh" is smallest, containing 1.19% of code.


*.rs622 LOC (61%) 5 files
*.md359 LOC (35%) 7 files
*.toml17 LOC (1%) 1 files
*.sh12 LOC (1%) 2 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
  • *.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
  • *.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
  • *.spec 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
  • *.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
  • *.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
  • *.hbs 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
  • *.yaml 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
  • *.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 15:09