A lot of bugs are caused by non-exhaustive matching in select statements.
If there is no Case Else one should be added that throws an exception.
Before:
Select Case A
Case B
DoSomething
Case C
DoSomethingElse
End Select
After:
Select Case A
Case B
DoSomething
Case C
DoSomethingElse
Case Else
Throw New Exception("Unexpected Case")
End Select
Should not raise for boolean if true and false are already handled:
Dim a = True
Select Case a
Case True
Case False
End Select
Diagnostic Id: CC0120
Category: Design
Severity: Warning
A lot of bugs are caused by non-exhaustive matching in select statements.
If there is no Case Else one should be added that throws an exception.
Before:
After:
Should not raise for boolean if true and false are already handled:
Diagnostic Id:
CC0120Category:
DesignSeverity:
Warning