awslabs / aws-lc
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
S
txt
s
cmake
in
obj
lds
mod
gn
clang-format
  • 26 extensions are included in analyses: c, cc, h, S, json, txt, go, pl, py, md, sh, asm, s, yml, yaml, cmake, in, ps1, bat, gitignore, obj, lds, css, mod, gn, clang-format
  • 8 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 ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (364 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (1 file).
    • exclude files with path like ".*/testdata/.*" (Test data) (34 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) (64 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.

main508230 LOC (87%) 836 files
test69741 LOC (12%) 268 files
generated0 LOC (0%) 0 files
build and deployment277 LOC (<1%) 5 files
other2464 LOC (<1%) 33 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
lds
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 836 files match defined criteria (508,230 lines of code, 100.0% vs. main code):
    • 123 *.s files (203,706 lines of code)
    • 337 *.c files (79,580 lines of code)
    • 30 *.asm files (62,547 lines of code)
    • 58 *.pl files (56,720 lines of code)
    • 144 *.h files (54,549 lines of code)
    • 76 *.cc files (30,587 lines of code)
    • 50 *.go files (19,147 lines of code)
    • 10 *.py files (905 lines of code)
    • 5 *.cmake files (381 lines of code)
    • 1 *.css files (57 lines of code)
    • 2 *.lds files (51 lines of code)
  • " *.s" is biggest, containing 40.08% of code.
  • " *.lds" is smallest, containing 0.01% of code.


*.s203706 LOC (40%) 123 files
*.c79580 LOC (15%) 337 files
*.asm62547 LOC (12%) 30 files
*.pl56720 LOC (11%) 58 files
*.h54549 LOC (10%) 144 files
*.cc30587 LOC (6%) 76 files
*.go19147 LOC (3%) 50 files
*.py905 LOC (<1%) 10 files
*.cmake381 LOC (<1%) 5 files
*.css57 LOC (<1%) 1 files
*.lds51 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
s
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • 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/.*".
  • 268 files match defined criteria (69,741 lines of code, 13.7% vs. main code):
    • 109 *.cc files (43,118 lines of code)
    • 39 *.go files (15,899 lines of code)
    • 10 *.s files (4,939 lines of code)
    • 14 *.h files (1,375 lines of code)
    • 31 *.sh files (1,118 lines of code)
    • 5 *.pl files (803 lines of code)
    • 18 *.py files (725 lines of code)
    • 2 *.asm files (623 lines of code)
    • 8 *.yaml files (585 lines of code)
    • 6 *.c files (276 lines of code)
    • 22 *.yml files (199 lines of code)
    • 2 *.bat files (60 lines of code)
    • 2 *.ps1 files (21 lines of code)
  • " *.cc" is biggest, containing 61.83% of code.
  • " *.ps1" is smallest, containing 0.03% of code.


*.cc43118 LOC (61%) 109 files
*.go15899 LOC (22%) 39 files
*.s4939 LOC (7%) 10 files
*.h1375 LOC (1%) 14 files
*.sh1118 LOC (1%) 31 files
*.pl803 LOC (1%) 5 files
*.py725 LOC (1%) 18 files
*.asm623 LOC (<1%) 2 files
*.yaml585 LOC (<1%) 8 files
*.c276 LOC (<1%) 6 files
*.yml199 LOC (<1%) 22 files
*.bat60 LOC (<1%) 2 files
*.ps121 LOC (<1%) 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 ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 5 files match defined criteria (277 lines of code, 0.1% vs. main code). All matches are in *.sh files.


*.sh277 LOC (100%) 5 files
Other Code
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/go[.]mod".
  • 33 files match defined criteria (2,464 lines of code, 0.5% vs. main code):
    • 27 *.md files (2,265 lines of code)
    • 5 *.json files (193 lines of code)
    • 1 *.mod files (6 lines of code)
  • " *.md" is biggest, containing 91.92% of code.
  • " *.mod" is smallest, containing 0.24% of code.


*.md2265 LOC (91%) 27 files
*.json193 LOC (7%) 5 files
*.mod6 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.asm 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
  • *.pl files are analyzed with PerlAnalyzer:
    • 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
  • *.cc 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
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
  • *.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
  • *.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
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.lds 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 19:26