Consolidate Conditional Expression

Removes smells
Symptom

Multiple conditions in sequence (or chained) leading to the same action — three guard clauses each returning 0, or three branches each running the same handler.

Goal

Multiple conditions leading to the same action collapse into one named predicate.

Before the refactoring

if (employee.seniority < 2) return 0;
if (employee.monthsDisabled > 12) return 0;
if (employee.isPartTime) return 0;

After the refactoring

if (isIneligibleForBonus(employee)) return 0;
Example source: Illustrative example written for this site, not a quotation from any source.
Pressure

The shared rationale is invisible; adding a new condition with the same effect means touching N places; bugs hide where one of the branches diverges accidentally.

Tradeoff

Combining conditions can hide their independent reasons — only consolidate when they truly express the same business rule.

Relief

The shared rationale becomes visible and namable; new conditions extend one place instead of N.

Trap

Combining conditions that look the same but encode independent reasons — the consolidated predicate hides distinct rules that need to evolve separately.