Benign powershell Download

PSComplexity 0.1.0

PowerShell comment-help installer examplePS1 file written to disk
SHA-256ee079a75404452a0a03ed77fb413b32d1ead2fcb65b018ebcebef2bc0e15c98d

Evidence

powershell keyword PSComplexity.psm1 · lines 1–4
1# PSComplexity - cyclomatic + cognitive complexity for PowerShell.
2# Dot-source the implementation (small, single-responsibility units) and export the
3# public surface. Ast.ps1 provides the shared helpers the metric files depend on, so
4# it loads first.
PS1 file written to disk PSComplexity.psm1 · lines 6–9
6$src = Join-Path $PSScriptRoot 'src'
7foreach ($file in @('Ast.ps1', 'Cyclomatic.ps1', 'Cognitive.ps1', 'Measure-PSComplexity.ps1')) {
8 . (Join-Path $src $file)
9}
PowerShell comment-help installer example Measure-PSComplexity.ps1 · lines 13–44
13:59… { $_.FullName })
14}
15
16function Measure-PSComplexity {
17 <#
18 .SYNOPSIS
19 Measure cyclomatic and cognitive complexity of PowerShell code, per unit
20 (each function/filter, plus one <script-body> per file for top-level code).
⋯24 lines
powershell keyword PSComplexity.psd1 · lines 5–10
5 Author = 'Fortigi'
6 CompanyName = 'Fortigi'
7 Copyright = '(c) Fortigi. MIT licensed.'
8 Description = '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.'
9 PowerShellVersion = '7.2'
10 CompatiblePSEditions = @('Core')
HTTP/HTTPS URL literal PSComplexity.psd1 · lines 18–22
18 PSData = @{
19 Tags = @('complexity', 'cyclomatic', 'cognitive', 'code-quality', 'ast', 'metrics', 'maintainability', 'lint', 'ci')
20 LicenseUri = 'https://github.com/Fortigi/PSComplexity/blob/main/LICENSE'
21 ProjectUri = 'https://github.com/Fortigi/PSComplexity'
22 ReleaseNotes = 'Initial release: per-unit cyclomatic and (faithful, reference-validated) cognitive complexity via the PowerShell AST; Measure-PSComplexity and a Test-PSComplexity CI gate.'

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.