There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
AV1536 Add a default block in switch/case
I'd reduce the level of this rule from (1) to (2) as in the next rule AV1537 since they're basically the same thing with different syntax, and I'd probably often choose to not do this if I only want to handle a few cases out of many. Adding a reasoned
empty block every time only makes the code longer and mostly states what is already obvious. Here I'd go for less code.
Throwing an exception in the default or else block is a good idea though if the previous conditions are supposed to be comprehensive and other cases are unexpected.