PSComplexity
0.1.0
Cyclomatic and cognitive complexity for PowerShell. Cognitive complexity is a faithful port of the SonarSource metric (nesting-aware -- the better signal for "hard to understand"), validated against reference scores. Measures per unit (function/filter + script body) via the PowerShell AST; ships a Test-PSComplexity gate for CI.
Minimum PowerShell version
7.2
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
Initial release: per-unit cyclomatic and (faithful, reference-validated) cognitive complexity via the PowerShell AST; Measure-PSComplexity and a Test-PSComplexity CI gate.
FileList
- PSComplexity.nuspec
- LICENSE
- PSComplexity.psd1
- PSComplexity.psm1
- README.md
- src\Ast.ps1
- src\Cognitive.ps1
- src\Cyclomatic.ps1
- src\Measure-PSComplexity.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 0.1.0 (current version) | 11 | 7/3/2026 |