PSComplexity
0.7.1
Cyclomatic and cognitive complexity for PowerShell. Cognitive complexity implements the SonarSource metric in full (nesting-aware -- the better signal for "hard to understand"), scoring every reference example exactly as published, and extends it for PowerShell constructs the specification does not cover: ForEach-Object and Where-Object, the .ForEach() and .Where() me
Cyclomatic and cognitive complexity for PowerShell. Cognitive complexity implements the SonarSource metric in full (nesting-aware -- the better signal for "hard to understand"), scoring every reference example exactly as published, and extends it for PowerShell constructs the specification does not cover: ForEach-Object and Where-Object, the .ForEach() and .Where() methods, the && and || pipeline chains, and ?? and ??=. Measures per unit (function/filter, class method/constructor, initialised class property, + script body) via the PowerShell AST; ships a Test-PSComplexity gate for CI.
Show more
Minimum PowerShell version
7.0
Installation Options
Owners
Copyright
(c) Fortigi. MIT licensed.
Package Details
Author(s)
- Fortigi
Tags
complexity cyclomatic cognitive code-quality ast metrics maintainability lint ci
Functions
Measure-PSComplexity Test-PSComplexity
PSEditions
Dependencies
This module has no dependencies.
Release Notes
PSComplexity 0.7.1
- Config paths are resolved the same way on every supported PowerShell.
Full release notes: https://github.com/Fortigi/PSComplexity/releases/tag/v0.7.1
FileList
- PSComplexity.nuspec
- LICENSE
- PSComplexity.psd1
- PSComplexity.psm1
- README.md
- rules\PSComplexity.Rules.psm1
- schemas\v1\config.schema.json
- schemas\v1\report.schema.json
- src\AnalyzerRule.ps1
- src\Ast.ps1
- src\BaselineFile.ps1
- src\Cognitive.ps1
- src\Config.ps1
- src\ConfigFile.ps1
- src\Cyclomatic.ps1
- src\Diff.ps1
- src\InlineAccept.ps1
- src\Markdown.ps1
- src\Measure-PSComplexity.ps1
- src\Policy.ps1
- src\Report.ps1
- src\Scan.ps1
- src\Size.ps1