azure / autorest.csharp
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
csproj
props
targets
txt
gitattributes
editorconfig
mjs
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.

main59161 LOC (2%) 746 files
test344757 LOC (17%) 1,619 files
generated1013453 LOC (50%) 9,073 files
build and deployment91 LOC (<1%) 2 files
other582487 LOC (29%) 2,841 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
targets
props
mjs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 746 files match defined criteria (59,161 LOC, 100.0% vs. main code):
    • 707 *.cs files (56,562 LOC)
    • 26 *.ps1 files (1,751 LOC)
    • 4 *.ts files (392 LOC)
    • 3 *.targets files (210 LOC)
    • 1 *.psm1 files (121 LOC)
    • 3 *.props files (103 LOC)
    • 1 *.js files (19 LOC)
    • 1 *.mjs files (3 LOC)
  • " *.cs" is biggest, containing 95.61% of LOC.
  • " *.mjs" is smallest, containing 0.01% of LOC.


*.cs56562 LOC (95%) 707 files
*.ps11751 LOC (2%) 26 files
*.ts392 LOC (<1%) 4 files
*.targets210 LOC (<1%) 3 files
*.psm1121 LOC (<1%) 1 file
*.props103 LOC (<1%) 3 files
*.js19 LOC (<1%) 1 file
*.mjs3 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
props
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.]UnitTests/.*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*/mock[a-zA-Z0-9_\- ]+/.*".
    • files with paths like ".*/[Mm]ocks/.*".
    • files with paths like ".*/TestData/.*".
  • 1619 files match defined criteria (344,757 LOC, 582.7% vs. main code):
    • 198 *.yaml files (221,675 LOC)
    • 312 *.xml files (77,496 LOC)
    • 663 *.cs files (39,226 LOC)
    • 429 *.csproj files (6,126 LOC)
    • 12 *.props files (137 LOC)
    • 3 *.targets files (49 LOC)
    • 1 *.psm1 files (27 LOC)
    • 1 *.ps1 files (21 LOC)
  • " *.yaml" is biggest, containing 64.3% of LOC.
  • " *.ps1" is smallest, containing 0.01% of LOC.


*.yaml221675 LOC (64%) 198 files
*.xml77496 LOC (22%) 312 files
*.cs39226 LOC (11%) 663 files
*.csproj6126 LOC (1%) 429 files
*.props137 LOC (<1%) 12 files
*.targets49 LOC (<1%) 3 files
*.psm127 LOC (<1%) 1 file
*.ps121 LOC (<1%) 1 file
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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 9073 files match defined criteria (1,013,453 LOC, 1713.0% vs. main code):
    • 9,072 *.cs files (1,004,750 LOC)
    • 1 *.json files (8,703 LOC)
  • " *.cs" is biggest, containing 99.14% of LOC.
  • " *.json" is smallest, containing 0.86% of LOC.


*.cs1004750 LOC (99%) 9,072 files
*.json8703 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 ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 2 files match defined criteria (91 LOC, 0.2% vs. main code). All matches are in *.csproj files.


*.csproj91 LOC (100%) 2 files
Other Code
csproj
txt
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
  • 2841 files match defined criteria (582,487 LOC, 984.6% vs. main code):
    • 606 *.json files (290,899 LOC)
    • 2,081 *.cs files (257,037 LOC)
    • 6 *.yaml files (22,397 LOC)
    • 4 *.xml files (8,246 LOC)
    • 82 *.md files (3,008 LOC)
    • 53 *.csproj files (604 LOC)
    • 4 *.txt files (236 LOC)
    • 1 *.ps1 files (31 LOC)
    • 4 *.props files (29 LOC)
  • " *.json" is biggest, containing 49.94% of LOC.
  • " *.props" is smallest, containing 0% of LOC.


*.json290899 LOC (49%) 606 files
*.cs257037 LOC (44%) 2,081 files
*.yaml22397 LOC (3%) 6 files
*.xml8246 LOC (1%) 4 files
*.md3008 LOC (<1%) 82 files
*.csproj604 LOC (<1%) 53 files
*.txt236 LOC (<1%) 4 files
*.ps131 LOC (<1%) 1 file
*.props29 LOC (<1%) 4 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.targets 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
  • *.props 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
  • *.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
  • *.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


2025-05-06 21:24