Switch Statements Should Have a When Else Case

Impact area

Manageability

Severity

high

Affected element

Salesforce

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


What's here


Related content

Apex Page rules

Salesforce rules




Last modified on Mar 1, 2024