azure / autorest.powershell
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
gitattributes
nuspec
resx
csproj
ejs
eslintignore
npmignore
npmrc
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.

main41285 LOC (14%) 318 files
test8847 LOC (3%) 641 files
generated100831 LOC (36%) 1,126 files
build and deployment3156 LOC (1%) 2 files
other122832 LOC (44%) 1,375 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ejs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 318 files match defined criteria (41,285 LOC, 100.0% vs. main code):
    • 122 *.ts files (23,507 LOC)
    • 123 *.cs files (8,892 LOC)
    • 20 *.ps1 files (3,099 LOC)
    • 27 *.yaml files (2,237 LOC)
    • 16 *.ejs files (1,458 LOC)
    • 4 *.js files (712 LOC)
    • 3 *.ps1xml files (678 LOC)
    • 1 *.psm1 files (346 LOC)
    • 1 *.psd1 files (343 LOC)
    • 1 *.xml files (13 LOC)
  • " *.ts" is biggest, containing 56.94% of LOC.
  • " *.xml" is smallest, containing 0.03% of LOC.


*.ts23507 LOC (56%) 122 files
*.cs8892 LOC (21%) 123 files
*.ps13099 LOC (7%) 20 files
*.yaml2237 LOC (5%) 27 files
*.ejs1458 LOC (3%) 16 files
*.js712 LOC (1%) 4 files
*.ps1xml678 LOC (1%) 3 files
*.psm1346 LOC (<1%) 1 file
*.psd1343 LOC (<1%) 1 file
*.xml13 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.]tests[.].*".
  • 641 files match defined criteria (8,847 LOC, 21.4% vs. main code):
    • 633 *.ps1 files (8,483 LOC)
    • 2 *.yaml files (214 LOC)
    • 6 *.ts files (150 LOC)
  • " *.ps1" is biggest, containing 95.89% of LOC.
  • " *.ts" is smallest, containing 1.7% of LOC.


*.ps18483 LOC (95%) 633 files
*.yaml214 LOC (2%) 2 files
*.ts150 LOC (1%) 6 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 ".*/generated/.*".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 1126 files match defined criteria (100,831 LOC, 244.2% vs. main code):
    • 1,125 *.cs files (100,823 LOC)
    • 1 *.ps1 files (8 LOC)
  • " *.cs" is biggest, containing 99.99% of LOC.
  • " *.ps1" is smallest, containing 0.01% of LOC.


*.cs100823 LOC (99%) 1,125 files
*.ps18 LOC (<1%) 1 file
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/pnpm.*[.]ya?ml".
  • 2 files match defined criteria (3,156 LOC, 7.6% vs. main code):
    • 1 *.yaml files (3,118 LOC)
    • 1 *.csproj files (38 LOC)
  • " *.yaml" is biggest, containing 98.8% of LOC.
  • " *.csproj" is smallest, containing 1.2% of LOC.


*.yaml3118 LOC (98%) 1 file
*.csproj38 LOC (1%) 1 file
Other Code
txt
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 ".*/[Ee]xamples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/[Ss]amples/.*".
  • 1375 files match defined criteria (122,832 LOC, 297.5% vs. main code):
    • 1,170 *.json files (104,812 LOC)
    • 193 *.md files (10,046 LOC)
    • 8 *.txt files (7,599 LOC)
    • 2 *.yaml files (340 LOC)
    • 1 *.cs files (27 LOC)
    • 1 *.ps1 files (8 LOC)
  • " *.json" is biggest, containing 85.33% of LOC.
  • " *.ps1" is smallest, containing 0.01% of LOC.


*.json104812 LOC (85%) 1,170 files
*.md10046 LOC (8%) 193 files
*.txt7599 LOC (6%) 8 files
*.yaml340 LOC (<1%) 2 files
*.cs27 LOC (<1%) 1 file
*.ps18 LOC (<1%) 1 file
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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 namespace heuristics)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.ps1xml files are analyzed with XmlAnalyzer:
    • 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
  • *.psm1 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
  • *.psd1 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
  • *.xml files are analyzed with XmlAnalyzer:
    • 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


2025-05-06 21:30