Guard Deletion Remote Use
Detects removed null or validation guards where the guarded symbol is still used later in the same method.
Why this rule exists
Deleting a guard while retaining downstream use reintroduces NullReferenceException or invalid-state paths that tests may not exercise.
Code example
- if (order is null) throw new ArgumentNullException(nameof(order));
return order.Total;- if (order is null) throw new ArgumentNullException(nameof(order));
+ if (order is null) return 0;
return order.Total;Configuration
Disable or adjust the severity of this rule in .gauntletci.json:
{
"rules": {
"GCI0059": { "enabled": true, "severity": "Block" }
}
}See Configuration for the full schema.
Related rules
Behavioral Change Detection
Detects removed logic (Warn), incompatible method signature changes (Block), backward-compatible extensions (Info), and cryptographic boundary changes (Block).
Edge Case Handling
Detects potential null dereferences and missing validation in added code.
Error Handling Integrity
Detects swallowed exceptions (empty catch blocks) and exception handling patterns that hide failures from callers and operators.
Implemented in src/GauntletCI.Core/Rules/Implementations/GCI0059_*.cs.
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.
