brooks-lint grounded in 12 classic engineering books
Your code
class UserService: def update_profile(self, user_id, name, email, avatar): user = self.db.query(f"SELECT * FROM users WHERE id = {user_id}") user['email'] = email # ... if user['email'] != email: # always False self.smtp.send(...) points = user['login_count'] * 10 + 500 self.db.execute(f"UPDATE loyalty SET points={points} ...") self.cache.invalidate(f"user:{user_id}")
→
brooks-lint verdict
28/ 100 Health Score

#### 🔴 R2 — Change Propagation

Symptom: one method does updates, email, loyalty & cache.
Source: Fowler — Refactoring — Divergent Change
Remedy: extract Notification / Loyalty / CacheInvalidator.

#### 🔴 R6 — Domain Model Distortion

Symptom: email overwritten before the != check — dead branch.
Source: McConnell — Code Complete — Ch.17
Remedy: capture old_email before any mutation.

#### 🔴 R5 — Dependency Disorder + SQL injection ×2

Every finding: Symptom → Source → Consequence → Remedy