mcp-server-semgrep
Version:
MCP Server for Semgrep Integration - static code analysis with AI
20 lines (19 loc) • 654 B
YAML
rules:
- id: hardcoded-conditional
patterns:
- pattern-either:
- pattern: if (true) { ... }
- pattern: if (false) { ... }
- pattern: if ($VAR = true) { ... }
- pattern: if ($VAR = false) { ... }
- pattern: if ($EXPR && false) { ... }
- pattern: if (false && $EXPR) { ... }
- pattern: if ($EXPR || true) { ... }
- pattern: if (true || $EXPR) { ... }
message: This if statement will always have the same behavior and is therefore unnecessary.
languages: [java]
severity: ERROR
metadata:
category: correctness
technology:
- java