---
title: Switch Statements Should Have a When Else Case
description: "**Impact area** Manageability **Severity** High **Affected element** Apex Class (APPCL) ## Rule ID **SF-SWITCH-WO-WHEN-ELSE** ## Impact Potential unexpected functionality. ## Remediation Use a 'when else' case to account for all values. ### Time to fix 15 min"
url: "https://community-staging.qualityclouds.com/qcdocs/qcr/rules/switch-statements-should-have-a-when-else-case/"
updated: "2025-03-21"
category: Rules
---

# Switch Statements Should Have a When Else Case

**Impact area**

Manageability

**Severity**

High

**Affected element**

Apex Class (APPCL)

## Rule ID

**SF-SWITCH-WO-WHEN-ELSE**

## Impact

Potential unexpected functionality.

## Remediation

Use a 'when else' case to account for all values.

### Time to fix

15 min
