๐Ÿ“‹ Code Tracker AIโ„ข Documentation

Complete Rules Catalog - Version 3.0.0

๐Ÿ“Š Overview

62+

Total Rules

10

Languages

10

Categories

9

Quick Fixes

Supported Languages

Language Rules Primary Categories
Kotlin25Performance, Null Safety, Coroutines, Collections
Java3Performance, Code Quality
Python4Best Practices, Error Handling
JavaScript/TypeScript4Best Practices, Performance
C#3Performance, Resource Management
Go3Concurrency, Error Handling
Rust3Memory, Safety
PHP3Security, Code Quality
Ruby3Performance, Security
Universal11Security, Architecture, Testing

๐Ÿ”ฅ Kotlin Rules (25 Total)

R-STRCAT-001 HIGH

String Concatenation in Loop (O(nยฒ))

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")
    }
}
PERFORMANCE Quick Fix Available
R-NULL-001 HIGH

Non-null Assertion Risk (!!)

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
NULL_SAFETY Quick Fix Available
R-NPLUS1-010 CRITICAL

N+1 Query Pattern

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)
PERFORMANCE DATABASE

+ 22 more Kotlin rules covering Coroutines, Data Classes, Sealed Classes, Collections, Error Handling, and Memory Management

๐Ÿ“‚ Rule Categories

๐Ÿš€ PERFORMANCE

String concatenation, List operations, N+1 queries, blocking operations, collection inefficiencies

๐Ÿ”’ SECURITY

SQL injection, hardcoded secrets, weak cryptography, mass assignment, unsafe operations

โœ… NULL_SAFETY

Non-null assertions, missing null checks, unsafe nullable access

โš ๏ธ ERROR_HANDLING

Generic catches, empty catch blocks, ignored errors, bare except clauses

โšก CONCURRENCY

Thread.sleep in coroutines, blocking I/O, uncancelled coroutines, goroutine leaks

๐Ÿ’พ MEMORY

Manual GC calls, resource leaks, unnecessary clones, defer in loops

โœจ BEST_PRACTICE

Mutable data classes, var vs const, equality operators, type hints

๐Ÿ“ CODE_QUALITY

Cyclomatic complexity, long lines, magic numbers, missing documentation

๐Ÿ—๏ธ ARCHITECTURE

God classes, circular dependencies, hard-coded dependencies

๐Ÿงช TESTING

Missing assertions, flaky tests, too many assertions per test

๐ŸŒ All Languages

โ˜• Java (3 Rules)

String concatenation, ArrayList.contains(), == for strings

๐Ÿ Python (4 Rules)

Mutable defaults, bare except, list comprehensions, type hints

๐ŸŒ JavaScript/TS (4 Rules)

var vs const/let, == vs ===, missing await, callback hell

๐Ÿ”ท C# (3 Rules)

LINQ ToList() in loops, blocking async, IDisposable leaks

๐Ÿน Go (3 Rules)

Goroutine leaks, ignored errors, defer in loops

๐Ÿฆ€ Rust (3 Rules)

Unnecessary clone(), unsafe blocks, unwrap() in production

๐Ÿ˜ PHP (3 Rules)

SQL injection, loose comparison, missing type hints

๐Ÿ’Ž Ruby (3 Rules)

N+1 in Rails, mass assignment, broad rescue

๐Ÿ“š Learning Resources

Security Standards

Language Documentation