microsoft / vssetup.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
targets
csproj
gitattributes
resx
editorconfig
nuspec
cmd
  • 18 extensions are included in analyses: cs, json, md, yml, ps1, txt, gitignore, targets, csproj, ps1xml, psd1, dockerfile, gitattributes, resx, psm1, editorconfig, nuspec, cmd
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (6 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (3 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) (2 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.

main1607 LOC (41%) 32 files
test1510 LOC (39%) 19 files
generated48 LOC (1%) 1 files
build and deployment203 LOC (5%) 4 files
other468 LOC (12%) 10 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
targets
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 32 files match defined criteria (1,607 lines of code, 100.0% vs. main code):
    • 22 *.cs files (1,188 lines of code)
    • 3 *.yml files (162 lines of code)
    • 1 *.ps1 files (112 lines of code)
    • 1 *.ps1xml files (66 lines of code)
    • 2 *.targets files (39 lines of code)
    • 1 *.psd1 files (30 lines of code)
    • 1 *.psm1 files (6 lines of code)
    • 1 *.cmd files (4 lines of code)
  • " *.cs" is biggest, containing 73.93% of code.
  • " *.cmd" is smallest, containing 0.25% of code.


*.cs1188 LOC (73%) 22 files
*.yml162 LOC (10%) 3 files
*.ps1112 LOC (6%) 1 files
*.ps1xml66 LOC (4%) 1 files
*.targets39 LOC (2%) 2 files
*.psd130 LOC (1%) 1 files
*.psm16 LOC (<1%) 1 files
*.cmd4 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]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 19 files match defined criteria (1,510 lines of code, 94.0% vs. main code):
    • 15 *.cs files (1,143 lines of code)
    • 3 *.ps1 files (238 lines of code)
    • 1 *.csproj files (129 lines of code)
  • " *.cs" is biggest, containing 75.7% of code.
  • " *.csproj" is smallest, containing 8.54% of code.


*.cs1143 LOC (75%) 15 files
*.ps1238 LOC (15%) 3 files
*.csproj129 LOC (8%) 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 "[/][/][ ]*".
  • 1 file matches defined criteria (48 lines of code, 3.0% vs. main code). All matches are in *.cs files.


*.cs48 LOC (100%) 1 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]dockerfile".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]csproj".
  • 4 files match defined criteria (203 lines of code, 12.6% vs. main code):
    • 1 *.csproj files (129 lines of code)
    • 1 *.dockerfile files (32 lines of code)
    • 1 *.nuspec files (27 lines of code)
    • 1 *.yml files (15 lines of code)
  • " *.csproj" is biggest, containing 63.55% of code.
  • " *.yml" is smallest, containing 7.39% of code.


*.csproj129 LOC (63%) 1 files
*.dockerfile32 LOC (15%) 1 files
*.nuspec27 LOC (13%) 1 files
*.yml15 LOC (7%) 1 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 ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
  • 10 files match defined criteria (468 lines of code, 29.1% vs. main code):
    • 7 *.json files (359 lines of code)
    • 3 *.md files (109 lines of code)
  • " *.json" is biggest, containing 76.71% of code.
  • " *.md" is smallest, containing 23.29% of code.


*.json359 LOC (76%) 7 files
*.md109 LOC (23%) 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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.cmd 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


2022-01-30 14:32