awslabs / swagger-ui
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
npmrc
npmignore
gitattributes
dockerignore
editorconfig
txt
eslintignore
  • 19 extensions are included in analyses: js, jsx, yaml, md, scss, json, html, sh, yml, npmrc, css, npmignore, svg, gitattributes, dockerignore, editorconfig, gitignore, txt, eslintignore
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (22 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (22 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) (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.

main15536 LOC (14%) 200 files
test22737 LOC (20%) 243 files
generated32502 LOC (29%) 1 files
build and deployment499 LOC (<1%) 15 files
other37892 LOC (34%) 25 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 ".*".
  • 200 files match defined criteria (15,536 lines of code, 100.0% vs. main code):
    • 93 *.jsx files (7,693 lines of code)
    • 86 *.js files (5,429 lines of code)
    • 17 *.scss files (2,277 lines of code)
    • 2 *.html files (130 lines of code)
    • 2 *.yaml files (7 lines of code)
  • " *.jsx" is biggest, containing 49.52% of code.
  • " *.yaml" is smallest, containing 0.05% of code.


*.jsx7693 LOC (49%) 93 files
*.js5429 LOC (34%) 86 files
*.scss2277 LOC (14%) 17 files
*.html130 LOC (<1%) 2 files
*.yaml7 LOC (<1%) 2 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]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*(/|[-])selenium/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 243 files match defined criteria (22,737 lines of code, 146.4% vs. main code):
    • 115 *.js files (12,763 lines of code)
    • 88 *.yaml files (6,326 lines of code)
    • 36 *.jsx files (3,411 lines of code)
    • 3 *.html files (231 lines of code)
    • 1 *.css files (6 lines of code)
  • " *.js" is biggest, containing 56.13% of code.
  • " *.css" is smallest, containing 0.03% of code.


*.js12763 LOC (56%) 115 files
*.yaml6326 LOC (27%) 88 files
*.jsx3411 LOC (15%) 36 files
*.html231 LOC (1%) 3 files
*.css6 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".
  • 1 file matches defined criteria (32,502 lines of code, 209.2% vs. main code). All matches are in *.json files.


*.json32502 LOC (100%) 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 ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[-]lock[.]json".
  • 15 files match defined criteria (499 lines of code, 3.2% vs. main code):
    • 10 *.js files (409 lines of code)
    • 5 *.sh files (90 lines of code)
  • " *.js" is biggest, containing 81.96% of code.
  • " *.sh" is smallest, containing 18.04% of code.


*.js409 LOC (81%) 10 files
*.sh90 LOC (18%) 5 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]dockerignore".
  • 25 files match defined criteria (37,892 lines of code, 243.9% vs. main code):
    • 12 *.json files (35,171 lines of code)
    • 3 *.js files (2,430 lines of code)
    • 9 *.md files (290 lines of code)
    • 1 *.svg files (1 lines of code)
  • " *.json" is biggest, containing 92.82% of code.
  • " *.svg" is smallest, containing 0% of code.


*.json35171 LOC (92%) 12 files
*.js2430 LOC (6%) 3 files
*.md290 LOC (<1%) 9 files
*.svg1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.jsx 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
  • *.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
  • *.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


2022-01-31 22:38