aws / s2n-tls
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
patch
S
v
mk
cmake
TXT
ini
cfg
clang-format
gitmodules
  • 28 extensions are included in analyses: c, h, txt, sh, py, md, patch, yml, rs, gitignore, S, cc, toml, v, json, mk, svg, rb, cmake, pl, TXT, rst, java, xml, ini, cfg, clang-format, gitmodules
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (54 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (29 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (8 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) (168 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.

main52387 LOC (43%) 528 files
test65640 LOC (54%) 598 files
generated0 LOC (0%) 0 files
build and deployment453 LOC (<1%) 7 files
other1964 LOC (1%) 49 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
s
cmake
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 528 files match defined criteria (52,387 lines of code, 100.0% vs. main code):
    • 253 *.c files (39,029 lines of code)
    • 231 *.h files (8,157 lines of code)
    • 6 *.s files (1,736 lines of code)
    • 15 *.rs files (1,254 lines of code)
    • 3 *.py files (1,156 lines of code)
    • 13 *.yml files (888 lines of code)
    • 2 *.cmake files (94 lines of code)
    • 5 *.toml files (73 lines of code)
  • " *.c" is biggest, containing 74.5% of code.
  • " *.toml" is smallest, containing 0.14% of code.


*.c39029 LOC (74%) 253 files
*.h8157 LOC (15%) 231 files
*.s1736 LOC (3%) 6 files
*.rs1254 LOC (2%) 15 files
*.py1156 LOC (2%) 3 files
*.yml888 LOC (1%) 13 files
*.cmake94 LOC (<1%) 2 files
*.toml73 LOC (<1%) 5 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
v
mk
cfg
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 598 files match defined criteria (65,640 lines of code, 125.3% vs. main code):
    • 488 *.c files (56,255 lines of code)
    • 42 *.py files (6,485 lines of code)
    • 29 *.h files (897 lines of code)
    • 5 *.v files (688 lines of code)
    • 6 *.cc files (648 lines of code)
    • 21 *.sh files (474 lines of code)
    • 2 *.pl files (73 lines of code)
    • 1 *.mk files (60 lines of code)
    • 1 *.rb files (28 lines of code)
    • 1 *.cfg files (15 lines of code)
    • 1 *.rs files (14 lines of code)
    • 1 *.txt files (3 lines of code)
  • " *.c" is biggest, containing 85.7% of code.
  • " *.txt" is smallest, containing 0% of code.


*.c56255 LOC (85%) 488 files
*.py6485 LOC (9%) 42 files
*.h897 LOC (1%) 29 files
*.v688 LOC (1%) 5 files
*.cc648 LOC (<1%) 6 files
*.sh474 LOC (<1%) 21 files
*.pl73 LOC (<1%) 2 files
*.mk60 LOC (<1%) 1 files
*.rb28 LOC (<1%) 1 files
*.cfg15 LOC (<1%) 1 files
*.rs14 LOC (<1%) 1 files
*.txt3 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]mk".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*/docker[-]compose[.]yml".
  • 7 files match defined criteria (453 lines of code, 0.9% vs. main code):
    • 2 *.mk files (262 lines of code)
    • 4 *.sh files (153 lines of code)
    • 1 *.yml files (38 lines of code)
  • " *.mk" is biggest, containing 57.84% of code.
  • " *.yml" is smallest, containing 8.39% of code.


*.mk262 LOC (57%) 2 files
*.sh153 LOC (33%) 4 files
*.yml38 LOC (8%) 1 files
Other Code
patch
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 ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 49 files match defined criteria (1,964 lines of code, 3.7% vs. main code):
    • 25 *.md files (1,396 lines of code)
    • 22 *.patch files (523 lines of code)
    • 1 *.rst files (28 lines of code)
    • 1 *.ini files (17 lines of code)
  • " *.md" is biggest, containing 71.08% of code.
  • " *.ini" is smallest, containing 0.87% of code.


*.md1396 LOC (71%) 25 files
*.patch523 LOC (26%) 22 files
*.rst28 LOC (1%) 1 files
*.ini17 LOC (<1%) 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
  • *.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
  • *.s 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
  • *.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
  • *.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
  • *.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
  • *.cmake 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
  • *.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


2022-01-30 22:22