microsoft / TypeScript
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
jsonc
gitattributes
npmignore
dockerignore
editorconfig
mjs
eslintignore
  • 18 extensions are included in analyses: ts, js, txt, json, tsx, jsonc, md, yml, yaml, gitattributes, npmignore, dockerignore, ps1, editorconfig, svg, gitignore, mjs, eslintignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (37 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1091 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (1 file).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (135 files).
    • exclude files with path like ".*/prototype(.*)\.js" (Prototype) (3 files).
    • exclude files with path like ".*/target/.*" (Compiled files) (1 file).
    • 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).
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.

main240473 LOC (14%) 490 files
test1000975 LOC (60%) 29122 files
generated31750 LOC (1%) 17 files
build and deployment0 LOC (0%) 0 files
other393978 LOC (23%) 7240 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
mjs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 490 files match defined criteria (240,473 lines of code, 100.0% vs. main code):
    • 469 *.ts files (238,534 lines of code)
    • 19 *.js files (1,852 lines of code)
    • 1 *.ps1 files (62 lines of code)
    • 1 *.mjs files (25 lines of code)
  • " *.ts" is biggest, containing 99.19% of code.
  • " *.mjs" is smallest, containing 0.01% of code.


*.ts238534 LOC (99%) 469 files
*.js1852 LOC (<1%) 19 files
*.ps162 LOC (<1%) 1 files
*.mjs25 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
jsonc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/[Tt]est/.*".
  • 29122 files match defined criteria (1,000,975 lines of code, 416.3% vs. main code):
    • 12,432 *.js files (624,049 lines of code)
    • 16,220 *.ts files (278,745 lines of code)
    • 170 *.jsonc files (92,654 lines of code)
    • 300 *.tsx files (5,527 lines of code)
  • " *.js" is biggest, containing 62.34% of code.
  • " *.tsx" is smallest, containing 0.55% of code.


*.js624049 LOC (62%) 12432 files
*.ts278745 LOC (27%) 16220 files
*.jsonc92654 LOC (9%) 170 files
*.tsx5527 LOC (<1%) 300 files
Generated Code
Automatically generated files, not manually changed after generation.
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]generated[.][a-zA-Z]+".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/generated/.*".
  • 17 files match defined criteria (31,750 lines of code, 13.2% vs. main code):
    • 14 *.json files (31,747 lines of code)
    • 1 *.txt files (1 lines of code)
    • 1 *.js files (1 lines of code)
    • 1 *.ts files (1 lines of code)
  • " *.json" is biggest, containing 99.99% of code.
  • " *.ts" is smallest, containing 0% of code.


*.json31747 LOC (99%) 14 files
*.txt1 LOC (<1%) 1 files
*.js1 LOC (<1%) 1 files
*.ts1 LOC (<1%) 1 files
Other Code
txt
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 ".*[.]editorconfig".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Dd]emos?/.*".
  • 7240 files match defined criteria (393,978 lines of code, 163.8% vs. main code):
    • 5,665 *.txt files (318,048 lines of code)
    • 1,556 *.json files (70,283 lines of code)
    • 13 *.md files (5,536 lines of code)
    • 1 *.js files (75 lines of code)
    • 5 *.ts files (36 lines of code)
  • " *.txt" is biggest, containing 80.73% of code.
  • " *.ts" is smallest, containing 0.01% of code.


*.txt318048 LOC (80%) 5665 files
*.json70283 LOC (17%) 1556 files
*.md5536 LOC (1%) 13 files
*.js75 LOC (<1%) 1 files
*.ts36 LOC (<1%) 5 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
  • *.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
  • *.mjs 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


2022-01-30 08:52