microsoft / powerbi-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
targets
props
txt
proj
gitattributes
editorconfig
  • 16 extensions are included in analyses: cs, md, ps1, csproj, json, psd1, ps1xml, targets, psm1, props, txt, gitignore, proj, gitattributes, editorconfig, yml
  • 5 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 ".*/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) (1 file).
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.

main9749 LOC (39%) 184 files
test5881 LOC (23%) 55 files
generated0 LOC (0%) 0 files
build and deployment363 LOC (1%) 13 files
other8956 LOC (35%) 69 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
proj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 184 files match defined criteria (9,749 lines of code, 100.0% vs. main code):
    • 146 *.cs files (7,298 lines of code)
    • 16 *.ps1 files (1,056 lines of code)
    • 7 *.psd1 files (567 lines of code)
    • 6 *.ps1xml files (544 lines of code)
    • 4 *.targets files (158 lines of code)
    • 2 *.props files (64 lines of code)
    • 1 *.psm1 files (23 lines of code)
    • 1 *.yml files (20 lines of code)
    • 1 *.proj files (19 lines of code)
  • " *.cs" is biggest, containing 74.86% of code.
  • " *.proj" is smallest, containing 0.19% of code.


*.cs7298 LOC (74%) 146 files
*.ps11056 LOC (10%) 16 files
*.psd1567 LOC (5%) 7 files
*.ps1xml544 LOC (5%) 6 files
*.targets158 LOC (1%) 4 files
*.props64 LOC (<1%) 2 files
*.psm123 LOC (<1%) 1 files
*.yml20 LOC (<1%) 1 files
*.proj19 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 paths like ".*[.][Tt]est[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 55 files match defined criteria (5,881 lines of code, 60.3% vs. main code):
    • 48 *.cs files (5,693 lines of code)
    • 7 *.csproj files (188 lines of code)
  • " *.cs" is biggest, containing 96.8% of code.
  • " *.csproj" is smallest, containing 3.2% of code.


*.cs5693 LOC (96%) 48 files
*.csproj188 LOC (3%) 7 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]csproj".
  • 13 files match defined criteria (363 lines of code, 3.7% vs. main code). All matches are in *.csproj files.


*.csproj363 LOC (100%) 13 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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
  • 69 files match defined criteria (8,956 lines of code, 91.9% vs. main code):
    • 54 *.md files (5,195 lines of code)
    • 9 *.ps1 files (2,100 lines of code)
    • 2 *.psm1 files (1,069 lines of code)
    • 4 *.json files (592 lines of code)
  • " *.md" is biggest, containing 58.01% of code.
  • " *.json" is smallest, containing 6.61% of code.


*.md5195 LOC (58%) 54 files
*.ps12100 LOC (23%) 9 files
*.psm11069 LOC (11%) 2 files
*.json592 LOC (6%) 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-30 15:45