Complete Rules Catalog - Version 3.0.0
Total Rules
Languages
Categories
Quick Fixes
| Language | Rules | Primary Categories |
|---|---|---|
| Kotlin | 25 | Performance, Null Safety, Coroutines, Collections |
| Java | 3 | Performance, Code Quality |
| Python | 4 | Best Practices, Error Handling |
| JavaScript/TypeScript | 4 | Best Practices, Performance |
| C# | 3 | Performance, Resource Management |
| Go | 3 | Concurrency, Error Handling |
| Rust | 3 | Memory, Safety |
| PHP | 3 | Security, Code Quality |
| Ruby | 3 | Performance, Security |
| Universal | 11 | Security, Architecture, Testing |
Why: Each += creates new String object (immutable), causing O(nยฒ) complexity
Fix: Use buildString { append() } or StringBuilder
// โ BAD - O(nยฒ)
var result = ""
for (i in 1..1000) {
result += "Item $i"
}
// โ
GOOD - O(n)
val result = buildString {
for (i in 1..1000) {
append("Item $i")
}
}
Why: Throws NullPointerException if null, defeats Kotlin null safety
Fix: Use safe call ?. or let { }
// โ BAD - Can crash val length = value!!.length // โ GOOD - Safe val length = value?.length ?: 0
Why: Database query per loop iteration = N+1 round-trips
Fix: Batch with IN clause or fetch join
// โ BAD - N+1 queries
users.forEach { user ->
val orders = orderRepository.findByUserId(user.id)
}
// โ
GOOD - 1 query
val userIds = users.map { it.id }
val orders = orderRepository.findByUserIdIn(userIds)
+ 22 more Kotlin rules covering Coroutines, Data Classes, Sealed Classes, Collections, Error Handling, and Memory Management
String concatenation, List operations, N+1 queries, blocking operations, collection inefficiencies
SQL injection, hardcoded secrets, weak cryptography, mass assignment, unsafe operations
Non-null assertions, missing null checks, unsafe nullable access
Generic catches, empty catch blocks, ignored errors, bare except clauses
Thread.sleep in coroutines, blocking I/O, uncancelled coroutines, goroutine leaks
Manual GC calls, resource leaks, unnecessary clones, defer in loops
Mutable data classes, var vs const, equality operators, type hints
Cyclomatic complexity, long lines, magic numbers, missing documentation
God classes, circular dependencies, hard-coded dependencies
Missing assertions, flaky tests, too many assertions per test
String concatenation, ArrayList.contains(), == for strings
Mutable defaults, bare except, list comprehensions, type hints
var vs const/let, == vs ===, missing await, callback hell
LINQ ToList() in loops, blocking async, IDisposable leaks
Goroutine leaks, ignored errors, defer in loops
Unnecessary clone(), unsafe blocks, unwrap() in production
SQL injection, loose comparison, missing type hints
N+1 in Rails, mass assignment, broad rescue