Skip to content

refactor: remove dead variables $config in Test-FeatureFlag begin{} and $validation in Test-Condition #33

@HeyItsGilbert

Description

@HeyItsGilbert

Summary

Two variables are assigned but never used. PSScriptAnalyzer flags both with PSUseDeclaredVarsMoreThanAssignments.

Files

File Line Variable Source Issue
Public/Test-FeatureFlag.ps1 41 $config Import-GatekeeperConfig Config reloaded by Invoke-Logging internally; this call is dead
Public/Test-Condition.ps1 86 $validation $meta.Validation Validation is passed via $meta to Test-TypedValue; $validation is never referenced

Fix

Remove both assignments:

# Test-FeatureFlag.ps1 begin{} — remove this line:
$config = Import-GatekeeperConfig

# Test-Condition.ps1 — remove this line:
$validation = $meta.Validation

Notes

  • Good first issue
  • Found by Brent Tlackburn and Chip Torres

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode quality, structure, or naming

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions