azure / azure-functions-powershell-library
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
resx
csproj
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.

main1414 LOC (57%) 28 files
test607 LOC (24%) 30 files
generated116 LOC (4%) 1 file
build and deployment31 LOC (1%) 1 file
other294 LOC (11%) 25 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 28 files match defined criteria (1,414 LOC, 100.0% vs. main code):
    • 23 *.cs files (961 LOC)
    • 3 *.ps1 files (197 LOC)
    • 1 *.psm1 files (172 LOC)
    • 1 *.psd1 files (84 LOC)
  • " *.cs" is biggest, containing 67.96% of LOC.
  • " *.psd1" is smallest, containing 5.94% of LOC.


*.cs961 LOC (67%) 23 files
*.ps1197 LOC (13%) 3 files
*.psm1172 LOC (12%) 1 file
*.psd184 LOC (5%) 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[.].*".
  • 30 files match defined criteria (607 LOC, 42.9% vs. main code):
    • 14 *.ps1 files (372 LOC)
    • 7 *.psm1 files (145 LOC)
    • 9 *.psd1 files (90 LOC)
  • " *.ps1" is biggest, containing 61.29% of LOC.
  • " *.psd1" is smallest, containing 14.83% of LOC.


*.ps1372 LOC (61%) 14 files
*.psm1145 LOC (23%) 7 files
*.psd190 LOC (14%) 9 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 ".*/src/gen/.*".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 1 file matches defined criteria (116 LOC, 8.2% vs. main code). All matches are in *.cs files.


*.cs116 LOC (100%) 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 ".*[.]csproj".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 1 file matches defined criteria (31 LOC, 2.2% vs. main code). All matches are in *.csproj files.


*.csproj31 LOC (100%) 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 ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
  • 25 files match defined criteria (294 LOC, 20.8% vs. main code):
    • 20 *.json files (218 LOC)
    • 4 *.md files (75 LOC)
    • 1 *.txt files (1 LOC)
  • " *.json" is biggest, containing 74.15% of LOC.
  • " *.txt" is smallest, containing 0.34% of LOC.


*.json218 LOC (74%) 20 files
*.md75 LOC (25%) 4 files
*.txt1 LOC (<1%) 1 file
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
  • *.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


2025-05-06 22:32