awslabs / performance-dashboard-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
snap
txt
npmignore
  • 16 extensions are included in analyses: tsx, ts, json, snap, md, css, scss, svg, gitignore, js, yml, sh, txt, html, npmignore, yaml
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (8 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 ".*\.d\.ts" (Typescript definition files) (3 files).
    • exclude files with path like ".*[.]txt" (Text files) (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.

main33673 LOC (21%) 278 files
test27370 LOC (17%) 240 files
generated42751 LOC (27%) 6 files
build and deployment215 LOC (<1%) 6 files
other51572 LOC (33%) 71 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 ".*".
  • 278 files match defined criteria (33,673 lines of code, 100.0% vs. main code):
    • 133 *.tsx files (21,763 lines of code)
    • 109 *.ts files (9,727 lines of code)
    • 1 *.yaml files (1,332 lines of code)
    • 12 *.scss files (377 lines of code)
    • 18 *.css files (269 lines of code)
    • 2 *.html files (164 lines of code)
    • 1 *.yml files (21 lines of code)
    • 2 *.js files (20 lines of code)
  • " *.tsx" is biggest, containing 64.63% of code.
  • " *.js" is smallest, containing 0.06% of code.


*.tsx21763 LOC (64%) 133 files
*.ts9727 LOC (28%) 109 files
*.yaml1332 LOC (3%) 1 files
*.scss377 LOC (1%) 12 files
*.css269 LOC (<1%) 18 files
*.html164 LOC (<1%) 2 files
*.yml21 LOC (<1%) 1 files
*.js20 LOC (<1%) 2 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 ".*[-]tests/.*".
    • files with paths like ".*[.]spec[.]ts".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*/__mocks?__/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 240 files match defined criteria (27,370 lines of code, 81.3% vs. main code):
    • 51 *.snap files (11,439 lines of code)
    • 81 *.ts files (9,817 lines of code)
    • 107 *.tsx files (6,112 lines of code)
    • 1 *.js files (2 lines of code)
  • " *.snap" is biggest, containing 41.79% of code.
  • " *.js" is smallest, containing 0.01% of code.


*.snap11439 LOC (41%) 51 files
*.ts9817 LOC (35%) 81 files
*.tsx6112 LOC (22%) 107 files
*.js2 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".
  • 6 files match defined criteria (42,751 lines of code, 127.0% vs. main code). All matches are in *.json files.


*.json42751 LOC (100%) 6 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 ".*/[.]gitignore".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 6 files match defined criteria (215 lines of code, 0.6% vs. main code):
    • 4 *.sh files (157 lines of code)
    • 2 *.js files (58 lines of code)
  • " *.sh" is biggest, containing 73.02% of code.
  • " *.js" is smallest, containing 26.98% of code.


*.sh157 LOC (73%) 4 files
*.js58 LOC (26%) 2 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 ".*[.]json".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]txt".
  • 71 files match defined criteria (51,572 lines of code, 153.2% vs. main code):
    • 51 *.json files (50,661 lines of code)
    • 9 *.ts files (525 lines of code)
    • 10 *.md files (381 lines of code)
    • 1 *.js files (5 lines of code)
  • " *.json" is biggest, containing 98.23% of code.
  • " *.js" is smallest, containing 0.01% of code.


*.json50661 LOC (98%) 51 files
*.ts525 LOC (1%) 9 files
*.md381 LOC (<1%) 10 files
*.js5 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.tsx 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-31 19:30