microsoft / accessibility-insights-web
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
nsh
dockerignore
gitattributes
prettierignore
  • 19 extensions are included in analyses: ts, tsx, snap, scss, js, html, yaml, json, md, txt, yml, nsh, dockerignore, gitattributes, ps1, sh, xml, gitignore, prettierignore
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (17 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (4 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (7 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 ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (3 files).
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.

main63710 LOC (25%) 1461 files
test163253 LOC (64%) 1474 files
generated0 LOC (0%) 0 files
build and deployment258 LOC (<1%) 2 files
other24506 LOC (9%) 32 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
nsh
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1461 files match defined criteria (63,710 lines of code, 100.0% vs. main code):
    • 723 *.ts files (29,855 lines of code)
    • 511 *.tsx files (26,005 lines of code)
    • 163 *.scss files (4,788 lines of code)
    • 28 *.js files (1,981 lines of code)
    • 25 *.yaml files (812 lines of code)
    • 9 *.html files (257 lines of code)
    • 1 *.ps1 files (7 lines of code)
    • 1 *.nsh files (5 lines of code)
  • " *.ts" is biggest, containing 46.86% of code.
  • " *.nsh" is smallest, containing 0.01% of code.


*.ts29855 LOC (46%) 723 files
*.tsx26005 LOC (40%) 511 files
*.scss4788 LOC (7%) 163 files
*.js1981 LOC (3%) 28 files
*.yaml812 LOC (1%) 25 files
*.html257 LOC (<1%) 9 files
*.ps17 LOC (<1%) 1 files
*.nsh5 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 ".*[-]tests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*[-]tests[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*/test[-]resources/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*/mock[-].*".
  • 1474 files match defined criteria (163,253 lines of code, 256.2% vs. main code):
    • 353 *.snap files (71,778 lines of code)
    • 582 *.ts files (58,790 lines of code)
    • 499 *.tsx files (31,570 lines of code)
    • 15 *.js files (537 lines of code)
    • 19 *.html files (472 lines of code)
    • 4 *.yaml files (68 lines of code)
    • 2 *.scss files (38 lines of code)
  • " *.snap" is biggest, containing 43.97% of code.
  • " *.scss" is smallest, containing 0.02% of code.


*.snap71778 LOC (43%) 353 files
*.ts58790 LOC (36%) 582 files
*.tsx31570 LOC (19%) 499 files
*.js537 LOC (<1%) 15 files
*.html472 LOC (<1%) 19 files
*.yaml68 LOC (<1%) 4 files
*.scss38 LOC (<1%) 2 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 2 files match defined criteria (258 lines of code, 0.4% vs. main code):
    • 1 *.js files (250 lines of code)
    • 1 *.sh files (8 lines of code)
  • " *.js" is biggest, containing 96.9% of code.
  • " *.sh" is smallest, containing 3.1% of code.


*.js250 LOC (96%) 1 files
*.sh8 LOC (3%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 32 files match defined criteria (24,506 lines of code, 38.5% vs. main code):
    • 7 *.ts files (16,064 lines of code)
    • 16 *.json files (8,168 lines of code)
    • 8 *.md files (229 lines of code)
    • 1 *.xml files (45 lines of code)
  • " *.ts" is biggest, containing 65.55% of code.
  • " *.xml" is smallest, containing 0.18% of code.


*.ts16064 LOC (65%) 7 files
*.json8168 LOC (33%) 16 files
*.md229 LOC (<1%) 8 files
*.xml45 LOC (<1%) 1 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.ps1 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
  • *.nsh files are analyzed with AdabasNaturalAnalyzer:
    • 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-30 22:31