aws-samples / aws-lex-net-chatbot
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
cshtml
txt
jshintrc
nuspec
jscsrc
csproj
  • 17 extensions are included in analyses: js, less, json, md, css, svg, cshtml, cs, txt, yml, bat, jshintrc, ps1, nuspec, jscsrc, csproj, yaml
  • 14 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 ".*/dist/.*" (Distributions) (9 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (215 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (1 file).
    • exclude files with path like ".*/jquery([^.]*)\.validate(\.unobtrusive)?\.js" (jQuery validation plugin (MS bundles this with asp.net mvc)) (0 files).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (1 file).
    • exclude files with path like ".*/effects\.js" (Prototype) (0 files).
    • exclude files with path like ".*/normalize[.](css|less|scss|styl)" (Normalize css) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (5 files).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (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.

main11437 LOC (63%) 120 files
test0 LOC (0%) 0 files
generated2679 LOC (14%) 1 files
build and deployment86 LOC (<1%) 7 files
other3873 LOC (21%) 25 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cshtml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 120 files match defined criteria (11,437 lines of code, 100.0% vs. main code):
    • 69 *.less files (5,374 lines of code)
    • 21 *.js files (2,444 lines of code)
    • 6 *.css files (2,404 lines of code)
    • 8 *.cshtml files (392 lines of code)
    • 1 *.yaml files (347 lines of code)
    • 8 *.cs files (331 lines of code)
    • 5 *.yml files (130 lines of code)
    • 2 *.ps1 files (15 lines of code)
  • " *.less" is biggest, containing 46.99% of code.
  • " *.ps1" is smallest, containing 0.13% of code.


*.less5374 LOC (46%) 69 files
*.js2444 LOC (21%) 21 files
*.css2404 LOC (21%) 6 files
*.cshtml392 LOC (3%) 8 files
*.yaml347 LOC (3%) 1 files
*.cs331 LOC (2%) 8 files
*.yml130 LOC (1%) 5 files
*.ps115 LOC (<1%) 2 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 ".*/npm[-]shrinkwrap[.]json".
  • 1 file matches defined criteria (2,679 lines of code, 23.4% vs. main code). All matches are in *.json files.


*.json2679 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
nuspec
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]bat".
  • 7 files match defined criteria (86 lines of code, 0.8% vs. main code):
    • 2 *.nuspec files (56 lines of code)
    • 1 *.csproj files (16 lines of code)
    • 4 *.bat files (14 lines of code)
  • " *.nuspec" is biggest, containing 65.12% of code.
  • " *.bat" is smallest, containing 16.28% of code.


*.nuspec56 LOC (65%) 2 files
*.csproj16 LOC (18%) 1 files
*.bat14 LOC (16%) 4 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 ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
  • 25 files match defined criteria (3,873 lines of code, 33.9% vs. main code):
    • 14 *.json files (3,096 lines of code)
    • 10 *.md files (762 lines of code)
    • 1 *.svg files (15 lines of code)
  • " *.json" is biggest, containing 79.94% of code.
  • " *.svg" is smallest, containing 0.39% of code.


*.json3096 LOC (79%) 14 files
*.md762 LOC (19%) 10 files
*.svg15 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.less files are analyzed with LessAnalyzer:
    • 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
  • *.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
  • *.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
  • *.cshtml 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
  • *.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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 (based on namespace heuristics)
  • *.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
  • *.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:42