mcp-server-semgrep
Version:
MCP Server for Semgrep Integration - static code analysis with AI
34 lines • 893 B
YAML
rules:
- id: baseclass-attribute-override
message: >-
Class $C inherits from both `$A` and `$B` which both have a method named
`$F`; one of these methods will be overwritten.
languages: [python]
severity: WARNING
patterns:
- pattern-inside: |
class $A(...):
...
def $F1(...):
...
...
...
- pattern-inside: |
class $B(...):
...
def $F2(...):
...
...
...
- metavariable-comparison:
comparison: str($F1) == str($F2)
- pattern: |
class $C(..., $A, ..., $B, ...):
...
- focus-metavariable: $C
metadata:
category: correctness
references:
- https://docs.python.org/3/tutorial/classes.html#multiple-inheritance
technology:
- python