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

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PSComplexity

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PSComplexity

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

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

Core

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

Version History

Version Downloads Last updated
0.1.0 (current version) 11 7/3/2026