microsoft / Partner-Center-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
csproj
proj
resx
props
txt
editorconfig
  • 15 extensions are included in analyses: cs, md, json, ps1, csproj, psm1, ps1xml, psd1, gitignore, proj, resx, props, txt, editorconfig, yml
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (128 files).
    • exclude files with path like ".*[.]resx" (The resx resource 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).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (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.

main11614 LOC (30%) 291 files
test867 LOC (2%) 22 files
generated25141 LOC (65%) 241 files
build and deployment90 LOC (<1%) 3 files
other451 LOC (1%) 6 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proj
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 291 files match defined criteria (11,614 lines of code, 100.0% vs. main code):
    • 283 *.cs files (10,266 lines of code)
    • 1 *.ps1xml files (517 lines of code)
    • 2 *.psm1 files (378 lines of code)
    • 1 *.psd1 files (228 lines of code)
    • 1 *.yml files (131 lines of code)
    • 1 *.ps1 files (45 lines of code)
    • 1 *.proj files (41 lines of code)
    • 1 *.props files (8 lines of code)
  • " *.cs" is biggest, containing 88.39% of code.
  • " *.props" is smallest, containing 0.07% of code.


*.cs10266 LOC (88%) 283 files
*.ps1xml517 LOC (4%) 1 files
*.psm1378 LOC (3%) 2 files
*.psd1228 LOC (1%) 1 files
*.yml131 LOC (1%) 1 files
*.ps145 LOC (<1%) 1 files
*.proj41 LOC (<1%) 1 files
*.props8 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 22 files match defined criteria (867 lines of code, 7.5% vs. main code):
    • 17 *.cs files (723 lines of code)
    • 4 *.ps1 files (99 lines of code)
    • 1 *.csproj files (45 lines of code)
  • " *.cs" is biggest, containing 83.39% of code.
  • " *.csproj" is smallest, containing 5.19% of code.


*.cs723 LOC (83%) 17 files
*.ps199 LOC (11%) 4 files
*.csproj45 LOC (5%) 1 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 241 files match defined criteria (25,141 lines of code, 216.5% vs. main code). All matches are in *.cs files.


*.cs25141 LOC (100%) 241 files
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 ".*[.]csproj".
  • 3 files match defined criteria (90 lines of code, 0.8% vs. main code). All matches are in *.csproj files.


*.csproj90 LOC (100%) 3 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
  • 6 files match defined criteria (451 lines of code, 3.9% vs. main code):
    • 5 *.md files (437 lines of code)
    • 1 *.json files (14 lines of code)
  • " *.md" is biggest, containing 96.9% of code.
  • " *.json" is smallest, containing 3.1% of code.


*.md437 LOC (96%) 5 files
*.json14 LOC (3%) 1 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)
  • *.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
  • *.yml 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
  • *.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
  • *.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
  • *.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


2022-01-30 21:58