All rules

Paired Implementation Consistency

Compares sibling class implementations for opposite boolean polarity on the same predicate.

Why this rule exists

Parallel implementations of the same behavior with inverted predicates usually indicate a copy/paste logic bug rather than an intentional difference.

Code example

Triggers the rule
+ // FooValidator and BarValidator disagree on the same IsActive check
+ if (!user.IsActive) return;
+ if (user.IsActive) return;
Passes the rule
+ // Both validators use the same polarity or document why they differ

Configuration

Disable or adjust the severity of this rule in .gauntletci.json:

{
  "rules": {
    "GCI0058": { "enabled": true, "severity": "Block" }
  }
}

See Configuration for the full schema.

Related rules

Real-world evidence

Implemented in src/GauntletCI.Core/Rules/Implementations/GCI0058_*.cs.

About the author

Eric Cogen -- Founder, GauntletCI

Twenty years as a senior technical consultant building and modernizing enterprise platforms across .NET, AWS, serverless, microservices, and AI-driven systems.