cdklabs / construct-hub-webapp
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
snap
npmignore
gitattributes
  • 14 extensions are included in analyses: ts, tsx, json, yml, md, js, txt, snap, css, npmignore, svg, gitignore, gitattributes, html
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (6 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (18 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) (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.

main10173 LOC (36%) 283 files
test3349 LOC (12%) 21 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other14355 LOC (51%) 20 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 ".*".
  • 283 files match defined criteria (10,173 lines of code, 100.0% vs. main code):
    • 132 *.tsx files (7,081 lines of code)
    • 144 *.ts files (2,984 lines of code)
    • 5 *.js files (58 lines of code)
    • 1 *.css files (30 lines of code)
    • 1 *.html files (20 lines of code)
  • " *.tsx" is biggest, containing 69.61% of code.
  • " *.html" is smallest, containing 0.2% of code.


*.tsx7081 LOC (69%) 132 files
*.ts2984 LOC (29%) 144 files
*.js58 LOC (<1%) 5 files
*.css30 LOC (<1%) 1 files
*.html20 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 ".*[.]spec[.]ts".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*/__mocks?__/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 21 files match defined criteria (3,349 lines of code, 32.9% vs. main code):
    • 19 *.ts files (1,985 lines of code)
    • 2 *.snap files (1,364 lines of code)
  • " *.ts" is biggest, containing 59.27% of code.
  • " *.snap" is smallest, containing 40.73% of code.


*.ts1985 LOC (59%) 19 files
*.snap1364 LOC (40%) 2 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
  • 20 files match defined criteria (14,355 lines of code, 141.1% vs. main code):
    • 12 *.json files (10,971 lines of code)
    • 7 *.md files (3,381 lines of code)
    • 1 *.svg files (3 lines of code)
  • " *.json" is biggest, containing 76.43% of code.
  • " *.svg" is smallest, containing 0.02% of code.


*.json10971 LOC (76%) 12 files
*.md3381 LOC (23%) 7 files
*.svg3 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
  • *.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
  • *.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-02-01 02:00