aws-samples / connected-drink-dispenser-workshop
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
mk
cmake
rake
in
S
s
ld
m4
cfg
gitattributes
adoc
editorconfig
clang-format
y
gyp
patch
glade
pxd
l
iss
spec
pyx
gitmodules
ino
properties
  • 54 extensions are included in analyses: h, c, py, txt, md, rb, yml, cc, mk, html, rst, cmake, rake, css, js, cpp, in, S, sh, svg, xml, s, ld, gitignore, toml, json, vue, hpp, inc, m4, cfg, go, asm, gitattributes, bat, adoc, editorconfig, yaml, clang-format, y, gyp, patch, glade, pxd, l, iss, spec, pyx, ps1, gitmodules, gemspec, ino, pl, properties
  • 16 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (44 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (293 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (0 files).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (1110 files).
    • exclude files with path like ".*/[Vv]endors?/.*" (Dependencies) (2882 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (0 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (0 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (0 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (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) (66 files).
    • exclude files with path like ".*/static/js/.*" (JS library) (0 files).
    • exclude files with path like ".*/ThirdParty/.*" (3rd library libraries) (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.

main191958 LOC (58%) 892 files
test26570 LOC (8%) 114 files
generated48511 LOC (14%) 2 files
build and deployment145 LOC (<1%) 2 files
other58953 LOC (18%) 80 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
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 892 files match defined criteria (191,958 lines of code, 100.0% vs. main code):
    • 268 *.c files (85,210 lines of code)
    • 340 *.h files (53,309 lines of code)
    • 179 *.py files (39,268 lines of code)
    • 47 *.s files (9,245 lines of code)
    • 16 *.cmake files (1,376 lines of code)
    • 12 *.vue files (1,283 lines of code)
    • 6 *.asm files (833 lines of code)
    • 8 *.js files (554 lines of code)
    • 6 *.cfg files (382 lines of code)
    • 4 *.html files (235 lines of code)
    • 3 *.inc files (149 lines of code)
    • 2 *.go files (111 lines of code)
    • 1 *.ps1 files (3 lines of code)
  • " *.c" is biggest, containing 44.39% of code.
  • " *.ps1" is smallest, containing 0% of code.


*.c85210 LOC (44%) 268 files
*.h53309 LOC (27%) 340 files
*.py39268 LOC (20%) 179 files
*.s9245 LOC (4%) 47 files
*.cmake1376 LOC (<1%) 16 files
*.vue1283 LOC (<1%) 12 files
*.asm833 LOC (<1%) 6 files
*.js554 LOC (<1%) 8 files
*.cfg382 LOC (<1%) 6 files
*.html235 LOC (<1%) 4 files
*.inc149 LOC (<1%) 3 files
*.go111 LOC (<1%) 2 files
*.ps13 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 ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 114 files match defined criteria (26,570 lines of code, 13.8% vs. main code):
    • 62 *.c files (23,153 lines of code)
    • 16 *.py files (1,946 lines of code)
    • 35 *.h files (1,464 lines of code)
    • 1 *.sh files (7 lines of code)
  • " *.c" is biggest, containing 87.14% of code.
  • " *.sh" is smallest, containing 0.03% of code.


*.c23153 LOC (87%) 62 files
*.py1946 LOC (7%) 16 files
*.h1464 LOC (5%) 35 files
*.sh7 LOC (<1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
  • 2 files match defined criteria (48,511 lines of code, 25.3% vs. main code). All matches are in *.json files.


*.json48511 LOC (100%) 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 ".*/package[-]lock[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*[.]mk".
    • files with paths like ".*/package[.]json".
  • 2 files match defined criteria (145 lines of code, 0.1% vs. main code):
    • 1 *.bat files (142 lines of code)
    • 1 *.sh files (3 lines of code)
  • " *.bat" is biggest, containing 97.93% of code.
  • " *.sh" is smallest, containing 2.07% of code.


*.bat142 LOC (97%) 1 files
*.sh3 LOC (2%) 1 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 ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 80 files match defined criteria (58,953 lines of code, 30.7% vs. main code):
    • 7 *.json files (50,312 lines of code)
    • 23 *.c files (6,227 lines of code)
    • 30 *.md files (1,706 lines of code)
    • 16 *.h files (457 lines of code)
    • 1 *.xml files (182 lines of code)
    • 1 *.rst files (42 lines of code)
    • 1 *.py files (26 lines of code)
    • 1 *.svg files (1 lines of code)
  • " *.json" is biggest, containing 85.34% of code.
  • " *.svg" is smallest, containing 0% of code.


*.json50312 LOC (85%) 7 files
*.c6227 LOC (10%) 23 files
*.md1706 LOC (2%) 30 files
*.h457 LOC (<1%) 16 files
*.xml182 LOC (<1%) 1 files
*.rst42 LOC (<1%) 1 files
*.py26 LOC (<1%) 1 files
*.svg1 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
  • *.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
  • *.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
  • *.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
  • *.vue 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
  • *.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
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.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
  • *.inc files are analyzed with PhpAnalyzer:
    • 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
  • *.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
  • *.ps1 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 15:58