22

Consolidate Conditional Expression


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;
Savings

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

Note

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