rspec/rules/S4524/description.adoc
cynthiabethea 316d39c88b
modify-S4524-minor-edit (#2595)
## Review

A dedicated reviewer checked the rule description successfully for:

- [ ] logical errors and incorrect information
- [ ] information gaps and missing content
- [ ] text style and tone
- [ ] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
2023-07-20 18:12:04 +01:00

6 lines
506 B
Plaintext

``++switch++`` can contain a ``++default++`` clause for various reasons: to handle unexpected values, to show that all the cases were properly considered, etc.
For readability purposes, to help a developer quickly spot the default behavior of a ``++switch++`` statement, it is recommended to put the ``++default++`` clause at the beginning or the end of the ``++switch++`` statement.
This rule raises an issue if the ``++default++`` clause is not the first or the last one of the ``++switch++``'s cases.