aws-amplify / amplify-codegen
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
hbs
npmignore
txt
editorconfig
prettierignore
  • 17 extensions are included in analyses: ts, js, graphql, json, snap, md, hbs, npmignore, yml, gql, gitignore, sh, yaml, txt, editorconfig, html, prettierignore
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (21 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 ".*/angular([^.]*)\.js" (AngularJS) (1 file).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • 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.

main32212 LOC (29%) 251 files
test56359 LOC (51%) 281 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other21586 LOC (19%) 37 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
hbs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 251 files match defined criteria (32,212 lines of code, 100.0% vs. main code):
    • 136 *.ts files (27,328 lines of code)
    • 89 *.js files (3,587 lines of code)
    • 12 *.graphql files (979 lines of code)
    • 2 *.gql files (239 lines of code)
    • 11 *.hbs files (68 lines of code)
    • 1 *.yml files (11 lines of code)
  • " *.ts" is biggest, containing 84.84% of code.
  • " *.yml" is smallest, containing 0.03% of code.


*.ts27328 LOC (84%) 136 files
*.js3587 LOC (11%) 89 files
*.graphql979 LOC (3%) 12 files
*.gql239 LOC (<1%) 2 files
*.hbs68 LOC (<1%) 11 files
*.yml11 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 ".*/[Tt]est/.*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[-]tests[-].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 281 files match defined criteria (56,359 lines of code, 175.0% vs. main code):
    • 17 *.snap files (30,713 lines of code)
    • 157 *.ts files (19,783 lines of code)
    • 51 *.js files (4,745 lines of code)
    • 56 *.graphql files (1,118 lines of code)
  • " *.snap" is biggest, containing 54.5% of code.
  • " *.graphql" is smallest, containing 1.98% of code.


*.snap30713 LOC (54%) 17 files
*.ts19783 LOC (35%) 157 files
*.js4745 LOC (8%) 51 files
*.graphql1118 LOC (1%) 56 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]prettierignore".
  • 37 files match defined criteria (21,586 lines of code, 67.0% vs. main code):
    • 25 *.json files (19,059 lines of code)
    • 12 *.md files (2,527 lines of code)
  • " *.json" is biggest, containing 88.29% of code.
  • " *.md" is smallest, containing 11.71% of code.


*.json19059 LOC (88%) 25 files
*.md2527 LOC (11%) 12 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.graphql 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
  • *.gql 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
  • *.hbs 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


2022-02-01 01:51