awslabs / service-workbench-on-aws
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
babelrc
mod
txt
snap
  • 19 extensions are included in analyses: js, json, md, yml, gitignore, sh, svg, go, css, babelrc, yaml, ps1, bash, mod, py, xml, html, txt, snap
  • 10 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (211 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (96 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 ".*/extern(al)?/.*" (Dependencies) (1 file).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (0 files).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (1 file).
    • 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.

main113078 LOC (57%) 989 files
test44711 LOC (22%) 391 files
generated14435 LOC (7%) 4 files
build and deployment1188 LOC (<1%) 29 files
other22339 LOC (11%) 228 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 989 files match defined criteria (113,078 lines of code, 100.0% vs. main code):
    • 880 *.js files (73,076 lines of code)
    • 3 *.yaml files (28,988 lines of code)
    • 91 *.yml files (8,703 lines of code)
    • 2 *.css files (1,083 lines of code)
    • 7 *.go files (1,056 lines of code)
    • 1 *.py files (80 lines of code)
    • 2 *.bash files (51 lines of code)
    • 2 *.ps1 files (25 lines of code)
    • 1 *.html files (16 lines of code)
  • " *.js" is biggest, containing 64.62% of code.
  • " *.html" is smallest, containing 0.01% of code.


*.js73076 LOC (64%) 880 files
*.yaml28988 LOC (25%) 3 files
*.yml8703 LOC (7%) 91 files
*.css1083 LOC (<1%) 2 files
*.go1056 LOC (<1%) 7 files
*.py80 LOC (<1%) 1 files
*.bash51 LOC (<1%) 2 files
*.ps125 LOC (<1%) 2 files
*.html16 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
snap
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • 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 ".*_test[.].*".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*/__mocks?__/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[.]spec[.]js".
    • files with any line of content like ".*/simpletest/.*".
  • 391 files match defined criteria (44,711 lines of code, 39.5% vs. main code):
    • 381 *.js files (43,733 lines of code)
    • 1 *.go files (675 lines of code)
    • 7 *.yml files (216 lines of code)
    • 1 *.snap files (68 lines of code)
    • 1 *.sh files (19 lines of code)
  • " *.js" is biggest, containing 97.81% of code.
  • " *.sh" is smallest, containing 0.04% of code.


*.js43733 LOC (97%) 381 files
*.go675 LOC (1%) 1 files
*.yml216 LOC (<1%) 7 files
*.snap68 LOC (<1%) 1 files
*.sh19 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".
  • 4 files match defined criteria (14,435 lines of code, 12.8% vs. main code). All matches are in *.json files.


*.json14435 LOC (100%) 4 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[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 29 files match defined criteria (1,188 lines of code, 1.1% vs. main code):
    • 26 *.sh files (1,025 lines of code)
    • 3 *.js files (163 lines of code)
  • " *.sh" is biggest, containing 86.28% of code.
  • " *.js" is smallest, containing 13.72% of code.


*.sh1025 LOC (86%) 26 files
*.js163 LOC (13%) 3 files
Other Code
mod
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 ".*[.]svg".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 228 files match defined criteria (22,339 lines of code, 19.8% vs. main code):
    • 181 *.json files (20,874 lines of code)
    • 39 *.md files (1,415 lines of code)
    • 3 *.yml files (18 lines of code)
    • 2 *.svg files (15 lines of code)
    • 1 *.mod files (12 lines of code)
    • 1 *.js files (4 lines of code)
    • 1 *.xml files (1 lines of code)
  • " *.json" is biggest, containing 93.44% of code.
  • " *.xml" is smallest, containing 0% of code.


*.json20874 LOC (93%) 181 files
*.md1415 LOC (6%) 39 files
*.yml18 LOC (<1%) 3 files
*.svg15 LOC (<1%) 2 files
*.mod12 LOC (<1%) 1 files
*.js4 LOC (<1%) 1 files
*.xml1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.bash files are analyzed with ShellAnalyzer:
    • 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
  • *.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


2022-01-31 19:22