aws-amplify / amplify-js
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
mdx
project
gitattributes
editorconfig
prefs
eslintignore
podspec
babelrc
properties
prettierignore
  • 35 extensions are included in analyses: ts, html, js, tsx, md, snap, json, scss, svg, css, hbs, npmignore, vue, gitignore, yml, java, h, txt, yaml, m, mdx, project, gitattributes, sh, xml, editorconfig, prefs, gradle, eslintignore, py, podspec, c, babelrc, properties, prettierignore
  • 10 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (157 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (201 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) (21 files).
    • exclude files with path like ".*/cache/.*" (Caches) (26 files).
    • exclude files with path like ".*/[Pp]ackages\/.+\.\d+\/.*" (NuGet) (0 files).
    • exclude files with path like ".*[.]txt" (Text files) (3 files).
    • exclude files with path like ".*/prettify[.]js" (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.

main65855 LOC (34%) 718 files
test101281 LOC (53%) 343 files
generated0 LOC (0%) 0 files
build and deployment1023 LOC (<1%) 39 files
other22566 LOC (11%) 169 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 ".*".
  • 718 files match defined criteria (65,855 lines of code, 100.0% vs. main code):
    • 350 *.ts files (32,371 lines of code)
    • 174 *.tsx files (15,962 lines of code)
    • 100 *.js files (6,119 lines of code)
    • 1 *.c files (4,455 lines of code)
    • 17 *.vue files (2,214 lines of code)
    • 6 *.h files (1,245 lines of code)
    • 35 *.scss files (1,096 lines of code)
    • 11 *.java files (1,095 lines of code)
    • 16 *.css files (660 lines of code)
    • 3 *.m files (519 lines of code)
    • 1 *.py files (67 lines of code)
    • 2 *.html files (36 lines of code)
    • 2 *.yml files (16 lines of code)
  • " *.ts" is biggest, containing 49.15% of code.
  • " *.yml" is smallest, containing 0.02% of code.


*.ts32371 LOC (49%) 350 files
*.tsx15962 LOC (24%) 174 files
*.js6119 LOC (9%) 100 files
*.c4455 LOC (6%) 1 files
*.vue2214 LOC (3%) 17 files
*.h1245 LOC (1%) 6 files
*.scss1096 LOC (1%) 35 files
*.java1095 LOC (1%) 11 files
*.css660 LOC (1%) 16 files
*.m519 LOC (<1%) 3 files
*.py67 LOC (<1%) 1 files
*.html36 LOC (<1%) 2 files
*.yml16 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 ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*[.]spec[.]ts".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/protractor[.]conf[.]js".
    • files with paths like ".*/karma[.]conf[.]js".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/__mocks?__/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*[.]snap".
    • files with any line of content like ".*/simpletest/.*".
  • 343 files match defined criteria (101,281 lines of code, 153.8% vs. main code):
    • 87 *.snap files (57,498 lines of code)
    • 168 *.ts files (32,006 lines of code)
    • 40 *.tsx files (6,459 lines of code)
    • 48 *.js files (5,318 lines of code)
  • " *.snap" is biggest, containing 56.77% of code.
  • " *.js" is smallest, containing 5.25% of code.


*.snap57498 LOC (56%) 87 files
*.ts32006 LOC (31%) 168 files
*.tsx6459 LOC (6%) 40 files
*.js5318 LOC (5%) 48 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
podspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]podspec".
  • 39 files match defined criteria (1,023 lines of code, 1.6% vs. main code):
    • 36 *.js files (925 lines of code)
    • 2 *.gradle files (80 lines of code)
    • 1 *.podspec files (18 lines of code)
  • " *.js" is biggest, containing 90.42% of code.
  • " *.podspec" is smallest, containing 1.76% of code.


*.js925 LOC (90%) 36 files
*.gradle80 LOC (7%) 2 files
*.podspec18 LOC (1%) 1 files
Other Code
mdx
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]mdx".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 169 files match defined criteria (22,566 lines of code, 34.3% vs. main code):
    • 99 *.md files (18,423 lines of code)
    • 66 *.json files (4,113 lines of code)
    • 2 *.mdx files (24 lines of code)
    • 2 *.xml files (6 lines of code)
  • " *.md" is biggest, containing 81.64% of code.
  • " *.xml" is smallest, containing 0.03% of code.


*.md18423 LOC (81%) 99 files
*.json4113 LOC (18%) 66 files
*.mdx24 LOC (<1%) 2 files
*.xml6 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
  • *.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
  • *.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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.vue 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
  • *.h 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
  • *.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
  • *.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)
  • *.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
  • *.m 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
  • *.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
  • *.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


2022-02-01 01:48