Rules Reference
Unfault analyzes your code across 195 production-readiness rules in Python, Go, Rust, and TypeScript. Each rule targets patterns that cause real incidents in production systems.
Rules by Language
Section titled “Rules by Language” Python Rules 60 rules covering stability, correctness, performance, and more.
Go Rules 56 rules for goroutine safety, error handling, and production patterns.
Rust Rules 44 rules for memory safety, async correctness, and panic prevention.
TypeScript Rules 35 rules for promise handling, type safety, and Node.js patterns.
Rules by Dimension
Section titled “Rules by Dimension”Unfault organizes rules into seven dimensions that map to the qualities that keep systems running reliably:
| Dimension | Focus | Example Rules |
|---|---|---|
| Stability | Preventing crashes and service degradation | Timeouts, graceful shutdown, bounded retries |
| Correctness | Preventing bugs and data corruption | SQL injection, error handling, type safety |
| Performance | Preventing slowdowns | N+1 queries, blocking in async, CPU in event loop |
| Scalability | Ensuring systems handle growth | Bounded concurrency, resource limits |
| Observability | Improving monitoring and debugging | Structured logging, correlation IDs, tracing |
| Security | Preventing vulnerabilities | Hardcoded secrets, unsafe eval, input validation |
| Maintainability | Ensuring code quality | Halstead complexity, code duplication |
Severity Levels
Section titled “Severity Levels”Each rule is assigned a severity based on its potential impact:
- Critical — Security vulnerabilities or data corruption risks
- High — Can cause outages or significant bugs
- Medium — May cause issues under load or edge cases
- Low — Best practices and code quality
Auto-Fix Support
Section titled “Auto-Fix Support”Most Unfault rules include auto-fix patches. When Unfault detects a violation, it can generate a diff showing exactly how to fix the issue. Apply patches with:
unfault review --apply