Repaso
Español
Design & PracticesIntermediateDP-25

A class has 3,000 lines and handles HTTP parsing, billing rules and PDF generation. This code smell is called…

Options

  1. Feature envy
  2. God object (Correct option)
  3. Shotgun surgery
  4. Primitive obsession

Answer

God object

Why

A 'god object' knows and does too much. It breaks the Single Responsibility Principle: many unrelated reasons to change, hard to test, and every developer edits it, causing conflicts.

Fix gradually: write tests around it, then extract cohesive classes (HttpParser, BillingRules, PdfRenderer).

Remember

Huge class doing everything = god object; split by responsibility.

Key terms

Practice this question in Repaso