aws-amplify / amplify-cli
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
ejs
npmignore
txt
mod
jscsrc
editorconfig
jshintrc
yy
l
prettierignore
  • 29 extensions are included in analyses: ts, js, json, md, snap, graphql, ejs, npmignore, sh, gitignore, py, yml, html, yaml, txt, css, tsx, java, mod, jscsrc, dart, editorconfig, jshintrc, yy, svg, go, l, gradle, prettierignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (114 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) (2 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (3 files).
    • exclude files with path like ".*[.]txt" (Text files) (4 files).
    • exclude files with path like ".*[-]debug[.]js" (Dev build) (2 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.

main146832 LOC (38%) 1579 files
test199566 LOC (52%) 958 files
generated2105 LOC (<1%) 2 files
build and deployment235 LOC (<1%) 9 files
other32078 LOC (8%) 502 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ejs
yy
l
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1579 files match defined criteria (146,832 lines of code, 100.0% vs. main code):
    • 1,124 *.ts files (109,595 lines of code)
    • 346 *.js files (25,388 lines of code)
    • 76 *.ejs files (9,601 lines of code)
    • 3 *.tsx files (657 lines of code)
    • 7 *.py files (509 lines of code)
    • 1 *.yy files (375 lines of code)
    • 4 *.css files (171 lines of code)
    • 1 *.go files (134 lines of code)
    • 1 *.l files (127 lines of code)
    • 3 *.java files (112 lines of code)
    • 8 *.graphql files (89 lines of code)
    • 3 *.html files (55 lines of code)
    • 1 *.yml files (15 lines of code)
    • 1 *.dart files (4 lines of code)
  • " *.ts" is biggest, containing 74.64% of code.
  • " *.dart" is smallest, containing 0% of code.


*.ts109595 LOC (74%) 1124 files
*.js25388 LOC (17%) 346 files
*.ejs9601 LOC (6%) 76 files
*.tsx657 LOC (<1%) 3 files
*.py509 LOC (<1%) 7 files
*.yy375 LOC (<1%) 1 files
*.css171 LOC (<1%) 4 files
*.go134 LOC (<1%) 1 files
*.l127 LOC (<1%) 1 files
*.java112 LOC (<1%) 3 files
*.graphql89 LOC (<1%) 8 files
*.html55 LOC (<1%) 3 files
*.yml15 LOC (<1%) 1 files
*.dart4 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]ests[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[.]tests[.].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*__test__.*".
    • files with paths like ".*/__mocks?__/.*".
    • files with paths like ".*/test[-]data/.*".
    • files with paths like ".*/mock[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 958 files match defined criteria (199,566 lines of code, 135.9% vs. main code):
    • 715 *.ts files (111,260 lines of code)
    • 83 *.snap files (75,297 lines of code)
    • 80 *.js files (11,794 lines of code)
    • 70 *.graphql files (798 lines of code)
    • 1 *.css files (190 lines of code)
    • 5 *.sh files (157 lines of code)
    • 1 *.yml files (30 lines of code)
    • 1 *.html files (25 lines of code)
    • 1 *.py files (9 lines of code)
    • 1 *.tsx files (6 lines of code)
  • " *.ts" is biggest, containing 55.75% of code.
  • " *.tsx" is smallest, containing 0% of code.


*.ts111260 LOC (55%) 715 files
*.snap75297 LOC (37%) 83 files
*.js11794 LOC (5%) 80 files
*.graphql798 LOC (<1%) 70 files
*.css190 LOC (<1%) 1 files
*.sh157 LOC (<1%) 5 files
*.yml30 LOC (<1%) 1 files
*.html25 LOC (<1%) 1 files
*.py9 LOC (<1%) 1 files
*.tsx6 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".
    • files with paths like ".*[.]js" AND any line of content like "[/][*] parser generated by jison .*".
  • 2 files match defined criteria (2,105 lines of code, 1.4% vs. main code):
    • 1 *.js files (2,104 lines of code)
    • 1 *.json files (1 lines of code)
  • " *.js" is biggest, containing 99.95% of code.
  • " *.json" is smallest, containing 0.05% of code.


*.js2104 LOC (99%) 1 files
*.json1 LOC (<1%) 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 ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 9 files match defined criteria (235 lines of code, 0.2% vs. main code):
    • 7 *.sh files (182 lines of code)
    • 1 *.gradle files (30 lines of code)
    • 1 *.yml files (23 lines of code)
  • " *.sh" is biggest, containing 77.45% of code.
  • " *.yml" is smallest, containing 9.79% of code.


*.sh182 LOC (77%) 7 files
*.gradle30 LOC (12%) 1 files
*.yml23 LOC (9%) 1 files
Other Code
mod
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 ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]prettierignore".
  • 502 files match defined criteria (32,078 lines of code, 21.8% vs. main code):
    • 394 *.json files (19,260 lines of code)
    • 100 *.md files (12,638 lines of code)
    • 1 *.ts files (103 lines of code)
    • 3 *.js files (38 lines of code)
    • 1 *.svg files (18 lines of code)
    • 1 *.html files (17 lines of code)
    • 2 *.mod files (4 lines of code)
  • " *.json" is biggest, containing 60.04% of code.
  • " *.mod" is smallest, containing 0.01% of code.


*.json19260 LOC (60%) 394 files
*.md12638 LOC (39%) 100 files
*.ts103 LOC (<1%) 1 files
*.js38 LOC (<1%) 3 files
*.svg18 LOC (<1%) 1 files
*.html17 LOC (<1%) 1 files
*.mod4 LOC (<1%) 2 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
  • *.ejs 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
  • *.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
  • *.py files are analyzed with PythonAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.yy files are analyzed with JsonAnalyzer:
    • 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
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.l 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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 package names)
  • *.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
  • *.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
  • *.dart files are analyzed with CppAnalyzer:
    • 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 01:48