Switch Statements Should Have a When Else Case

< 1 min read

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

Updated on March 21, 2025
Was it helpful ?