aws-samples / aws-serverless-workshops-kr
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
haml
plist
editorconfig
  • 18 extensions are included in analyses: scss, md, js, ts, css, html, json, gitignore, yaml, go, txt, haml, svg, py, rb, plist, sh, editorconfig
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/normalize[.](css|less|scss|styl)" (Normalize css) (2 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (6 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (1 file).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (2 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) (3 files).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (2 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.

main31446 LOC (87%) 196 files
test231 LOC (<1%) 12 files
generated0 LOC (0%) 0 files
build and deployment24 LOC (<1%) 1 files
other4172 LOC (11%) 55 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
haml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 196 files match defined criteria (31,446 lines of code, 100.0% vs. main code):
    • 27 *.js files (19,747 lines of code)
    • 82 *.scss files (4,487 lines of code)
    • 27 *.html files (2,371 lines of code)
    • 22 *.css files (2,281 lines of code)
    • 5 *.yaml files (1,378 lines of code)
    • 24 *.ts files (646 lines of code)
    • 4 *.go files (336 lines of code)
    • 3 *.haml files (83 lines of code)
    • 1 *.py files (60 lines of code)
    • 1 *.rb files (57 lines of code)
  • " *.js" is biggest, containing 62.8% of code.
  • " *.rb" is smallest, containing 0.18% of code.


*.js19747 LOC (62%) 27 files
*.scss4487 LOC (14%) 82 files
*.html2371 LOC (7%) 27 files
*.css2281 LOC (7%) 22 files
*.yaml1378 LOC (4%) 5 files
*.ts646 LOC (2%) 24 files
*.go336 LOC (1%) 4 files
*.haml83 LOC (<1%) 3 files
*.py60 LOC (<1%) 1 files
*.rb57 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 ".*[.]spec[.]ts".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/protractor[.]conf[.]js".
    • files with paths like ".*/karma[.]conf[.]js".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*/mock[-].*".
  • 12 files match defined criteria (231 lines of code, 0.7% vs. main code):
    • 9 *.ts files (167 lines of code)
    • 3 *.js files (64 lines of code)
  • " *.ts" is biggest, containing 72.29% of code.
  • " *.js" is smallest, containing 27.71% of code.


*.ts167 LOC (72%) 9 files
*.js64 LOC (27%) 3 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".
  • 1 file matches defined criteria (24 lines of code, 0.1% vs. main code). All matches are in *.sh files.


*.sh24 LOC (100%) 1 files
Other Code
plist
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 ".*[.]plist".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
  • 55 files match defined criteria (4,172 lines of code, 13.3% vs. main code):
    • 36 *.md files (3,450 lines of code)
    • 18 *.json files (642 lines of code)
    • 1 *.plist files (80 lines of code)
  • " *.md" is biggest, containing 82.69% of code.
  • " *.plist" is smallest, containing 1.92% of code.


*.md3450 LOC (82%) 36 files
*.json642 LOC (15%) 18 files
*.plist80 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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.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
  • *.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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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
  • *.haml 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
  • *.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
  • *.rb files are analyzed with RubyAnalyzer:
    • 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
    • Basic heuristic dependency analysis


2022-01-31 16:04