Python Rules
Unfault includes 60 rules for Python, covering core language patterns and popular frameworks like FastAPI, Django, Flask, SQLAlchemy, Redis, and Pydantic.
Core Rules (32 rules)
Section titled “Core Rules (32 rules)”Framework Rules
Section titled “Framework Rules”FastAPI (7 rules)
Section titled “FastAPI (7 rules)”| Rule | Dimension | Severity |
|---|---|---|
| missing_cors | Security | Medium |
| missing_health_check | Stability | Medium |
| exception_handler | Stability | Medium |
| input_validation | Correctness | High |
| rate_limiting | Scalability | Medium |
| request_body_unbounded | Scalability | High |
| missing_request_timeout | Stability | Medium |
Django (5 rules)
Section titled “Django (5 rules)”| Rule | Dimension | Severity |
|---|---|---|
| orm_select_related | Performance | Medium |
| allowed_hosts | Security | High |
| missing_csrf | Security | High |
| secure_settings | Security | High |
| session_settings | Security | Medium |
Flask (3 rules)
Section titled “Flask (3 rules)”| Rule | Dimension | Severity |
|---|---|---|
| cookie_settings | Security | Medium |
| secret_key | Security | Critical |
| session_timeout | Security | Medium |
SQLAlchemy (5 rules)
Section titled “SQLAlchemy (5 rules)”| Rule | Dimension | Severity |
|---|---|---|
| connection_pool | Scalability | High |
| lazy_loading | Performance | Medium |
| pgvector_optimization | Performance | Medium |
| query_timeout | Stability | High |
| session_management | Stability | High |
Redis (2 rules)
Section titled “Redis (2 rules)”| Rule | Dimension | Severity |
|---|---|---|
| missing_ttl | Scalability | Medium |
| unbounded_keys | Scalability | High |
Pydantic (2 rules)
Section titled “Pydantic (2 rules)”| Rule | Dimension | Severity |
|---|---|---|
| arbitrary_types | Correctness | Medium |
| missing_validators | Correctness | Medium |