aws-samples / aws-iot-alexa-connected-home-demo
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
ld
S
s
rake
in
cmake
cfg
project
cproject
m4
cmd
lds
xs
patch
gitattributes
tcl
spec
clang-format
y
ini
ccxml
editorconfig
glade
pxd
launch
l
rdf
iss
mss
pyx
vcxproj
gitmodules
gyp
make
ino
filters
prefs
properties
  • 69 extensions are included in analyses: h, c, rb, py, ftl, txt, mk, cc, ld, S, yml, md, s, rake, cpp, in, rst, sh, gitignore, cmake, html, json, cfg, inc, xml, project, hpp, cproject, bat, m4, cmd, yaml, go, asm, lds, xs, patch, js, gitattributes, tcl, pl, spec, clang-format, css, java, y, ini, ccxml, editorconfig, glade, pxd, svg, launch, l, toml, rdf, iss, mss, pyx, ps1, vcxproj, gitmodules, gemspec, gyp, make, ino, filters, prefs, properties
  • 13 criteria are used to exclude files from analysis:
    • 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 ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (71 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (7184 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (0 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 ".*[.]txt" (Text files) (39 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*/static/js/.*" (JS library) (0 files).
    • exclude files with path like ".*/ThirdParty/.*" (3rd library libraries) (0 files).
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.

main137783 LOC (71%) 688 files
test40664 LOC (21%) 483 files
generated0 LOC (0%) 0 files
build and deployment145 LOC (<1%) 2 files
other15015 LOC (7%) 178 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
s
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 688 files match defined criteria (137,783 lines of code, 100.0% vs. main code):
    • 281 *.c files (78,098 lines of code)
    • 296 *.h files (46,831 lines of code)
    • 41 *.s files (7,782 lines of code)
    • 42 *.py files (3,480 lines of code)
    • 6 *.asm files (833 lines of code)
    • 2 *.js files (220 lines of code)
    • 2 *.html files (167 lines of code)
    • 3 *.inc files (149 lines of code)
    • 2 *.go files (111 lines of code)
    • 1 *.yml files (50 lines of code)
    • 7 *.yaml files (28 lines of code)
    • 1 *.toml files (16 lines of code)
    • 3 *.cfg files (15 lines of code)
    • 1 *.ps1 files (3 lines of code)
  • " *.c" is biggest, containing 56.68% of code.
  • " *.ps1" is smallest, containing 0% of code.


*.c78098 LOC (56%) 281 files
*.h46831 LOC (33%) 296 files
*.s7782 LOC (5%) 41 files
*.py3480 LOC (2%) 42 files
*.asm833 LOC (<1%) 6 files
*.js220 LOC (<1%) 2 files
*.html167 LOC (<1%) 2 files
*.inc149 LOC (<1%) 3 files
*.go111 LOC (<1%) 2 files
*.yml50 LOC (<1%) 1 files
*.yaml28 LOC (<1%) 7 files
*.toml16 LOC (<1%) 1 files
*.cfg15 LOC (<1%) 3 files
*.ps13 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
ld
s
filters
cfg
mk
launch
cmd
ccxml
tcl
spec
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 ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 483 files match defined criteria (40,664 lines of code, 29.5% vs. main code):
    • 119 *.c files (23,133 lines of code)
    • 328 *.h files (9,519 lines of code)
    • 6 *.ld files (3,351 lines of code)
    • 6 *.s files (2,119 lines of code)
    • 1 *.filters files (1,323 lines of code)
    • 5 *.py files (631 lines of code)
    • 5 *.cfg files (179 lines of code)
    • 7 *.mk files (155 lines of code)
    • 1 *.launch files (151 lines of code)
    • 1 *.cmd files (68 lines of code)
    • 1 *.ccxml files (14 lines of code)
    • 1 *.tcl files (10 lines of code)
    • 1 *.bat files (9 lines of code)
    • 1 *.spec files (2 lines of code)
  • " *.c" is biggest, containing 56.89% of code.
  • " *.spec" is smallest, containing 0% of code.


*.c23133 LOC (56%) 119 files
*.h9519 LOC (23%) 328 files
*.ld3351 LOC (8%) 6 files
*.s2119 LOC (5%) 6 files
*.filters1323 LOC (3%) 1 files
*.py631 LOC (1%) 5 files
*.cfg179 LOC (<1%) 5 files
*.mk155 LOC (<1%) 7 files
*.launch151 LOC (<1%) 1 files
*.cmd68 LOC (<1%) 1 files
*.ccxml14 LOC (<1%) 1 files
*.tcl10 LOC (<1%) 1 files
*.bat9 LOC (<1%) 1 files
*.spec2 LOC (<1%) 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]mk".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]make".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitmodules".
  • 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
patch
cfg
mk
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 ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 178 files match defined criteria (15,015 lines of code, 10.9% vs. main code):
    • 39 *.c files (8,170 lines of code)
    • 5 *.xml files (2,455 lines of code)
    • 71 *.h files (1,799 lines of code)
    • 27 *.md files (805 lines of code)
    • 14 *.json files (520 lines of code)
    • 4 *.patch files (505 lines of code)
    • 5 *.py files (503 lines of code)
    • 3 *.cfg files (164 lines of code)
    • 8 *.mk files (63 lines of code)
    • 2 *.ini files (31 lines of code)
  • " *.c" is biggest, containing 54.41% of code.
  • " *.ini" is smallest, containing 0.21% of code.


*.c8170 LOC (54%) 39 files
*.xml2455 LOC (16%) 5 files
*.h1799 LOC (11%) 71 files
*.md805 LOC (5%) 27 files
*.json520 LOC (3%) 14 files
*.patch505 LOC (3%) 4 files
*.py503 LOC (3%) 5 files
*.cfg164 LOC (1%) 3 files
*.mk63 LOC (<1%) 8 files
*.ini31 LOC (<1%) 2 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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 16:08