Skip to content

chore: bump PSComplexity to 0.3.0 and PSMutant to 0.3.2 - #1073

Merged
TaekeK merged 1 commit into
mainfrom
feature/bump-ps-quality-tools
Aug 23, 2026
Merged

chore: bump PSComplexity to 0.3.0 and PSMutant to 0.3.2#1073
TaekeK merged 1 commit into
mainfrom
feature/bump-ps-quality-tools

Conversation

@TaekeK

@TaekeK TaekeK commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

PowerShell quality tools

  • Upgraded the PowerShell complexity measurer to PSComplexity 0.3.0, which now scores the branching PowerShell expresses through its own flow constructs — ForEach-Object/Where-Object (and aliases), the &&/|| pipeline chains, and the ??/??= operators — that earlier versions read as straight-line code, and no longer reports a passing gate when it silently measured nothing.
  • Upgraded the PowerShell mutation-testing tool to PSMutant 0.3.2, which refuses a per-mutant timeout too small to run the real suite (instead of reporting a flattering perfect score) and refuses a config path that escapes the source root.

Remeasure

PSComplexity 0.3.0's stricter cognitive metric surfaced 10 functions over the cog<=15 ceiling. All 10 were refactored below the ceiling, behaviour-preserving, by extracting helpers into already-dot-sourced sibling files (no new test wiring). The two near-identical Entra delta fetches now share one Split-FGDeltaResponse helper, cutting duplication as well.

cog before → after function
26 → 9 Sync-OmadaContexts
19 → 13 Get-EntraUserData
18 → 12 Sync-EntraPim
18 → 12 Get-EntraServicePrincipalData
18 → 13 Sync-EntraSignInLogs
17 → 13 Send-FGChunkedIngestBatches
16 → 1 Send-OmadaGovernanceAssignments
16 → 9 Get-MidpointContextsInTopologicalOrder
16 → 7 Write-CategoryBreakdown
16 → 13 Show-Summary

Both grandfathered Phases files shrank (Entra 1873→1857, Omada 1081→1061) and stay under their file-length ceilings. PSMutant 0.3.2's two new refusals don't apply to our config, so no mutation-config change was needed.

Verification

  • Complexity ratchet passes: cognitive 0 over threshold; cyclomatic OK (only the pre-existing grandfathered RollupMatrixView.jsx).
  • Affected Pester suites green: EntraIDCrawlerPhases, OmadaCrawlerPhases, CrawlerTransformOutputShape, MidpointCrawlerTransform (243 pass) + CrawlerIngest (52 pass).

🤖 Generated with Claude Code

PSComplexity 0.3.0 now scores the branching PowerShell expresses through
its own flow constructs (ForEach-Object/Where-Object, &&/||, ??/??=), which
older versions read as straight-line. Remeasuring surfaced 10 functions
over the cognitive ceiling; refactor all 10 below cog<=15 by extracting
helpers into already-dot-sourced siblings. The two near-identical Entra
delta fetches now share Split-FGDeltaResponse, cutting duplication too.
Both grandfathered Phases files shrank and stay under their ceilings.

PSMutant 0.3.2 refuses a per-mutant timeout too small to run the real suite
and a config path that escapes the source root; our config triggers neither.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@TaekeK
TaekeK merged commit 81e29b3 into main Aug 23, 2026
32 checks passed
@TaekeK
TaekeK deleted the feature/bump-ps-quality-tools branch August 23, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant