azure / azure-powershell-common
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
resx
proj
targets
txt
gitattributes
nuspec
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.

main68918 LOC (22%) 747 files
test2096 LOC (<1%) 23 files
generated229860 LOC (74%) 1,888 files
build and deployment796 LOC (<1%) 18 files
other5717 LOC (1%) 43 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proj
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 747 files match defined criteria (68,918 LOC, 100.0% vs. main code):
    • 738 *.cs files (68,763 LOC)
    • 5 *.proj files (116 LOC)
    • 4 *.targets files (39 LOC)
  • " *.cs" is biggest, containing 99.78% of LOC.
  • " *.targets" is smallest, containing 0.06% of LOC.


*.cs68763 LOC (99%) 738 files
*.proj116 LOC (<1%) 5 files
*.targets39 LOC (<1%) 4 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
targets
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 ".*/[Ss]pecs/.*".
    • files with paths like ".*UnitTests[.][a-zA-Z0-9_]+".
    • files with paths like ".*/TestData/.*".
  • 23 files match defined criteria (2,096 LOC, 3.0% vs. main code):
    • 18 *.cs files (1,998 LOC)
    • 4 *.csproj files (81 LOC)
    • 1 *.targets files (17 LOC)
  • " *.cs" is biggest, containing 95.32% of LOC.
  • " *.targets" is smallest, containing 0.81% of LOC.


*.cs1998 LOC (95%) 18 files
*.csproj81 LOC (3%) 4 files
*.targets17 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 1888 files match defined criteria (229,860 LOC, 333.5% vs. main code). All matches are in *.cs files.


*.cs229860 LOC (100%) 1,888 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
nuspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 18 files match defined criteria (796 LOC, 1.2% vs. main code):
    • 17 *.csproj files (780 LOC)
    • 1 *.nuspec files (16 LOC)
  • " *.csproj" is biggest, containing 97.99% of LOC.
  • " *.nuspec" is smallest, containing 2.01% of LOC.


*.csproj780 LOC (97%) 17 files
*.nuspec16 LOC (2%) 1 file
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
  • 43 files match defined criteria (5,717 LOC, 8.3% vs. main code):
    • 11 *.json files (5,070 LOC)
    • 29 *.md files (469 LOC)
    • 3 *.txt files (178 LOC)
  • " *.json" is biggest, containing 88.68% of LOC.
  • " *.txt" is smallest, containing 3.11% of LOC.


*.json5070 LOC (88%) 11 files
*.md469 LOC (8%) 29 files
*.txt178 LOC (3%) 3 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)
  • *.proj 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
  • *.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


2025-05-06 21:38