Inspection Details

EmptyElseBlock


Summary
Identifies empty 'Else' blocks that can be safely removed.
Reasoning
Empty code blocks are redundant, dead code that should be removed. They can also be misleading about their intent: an empty block may be signalling an unfinished thought or an oversight.
The following code example(s) would trigger this inspection:

Public Sub DoSomething(ByVal foo As Boolean)
    If foo Then
        ' ...
    Else
    End If
End Sub

The following code example(s) would not trigger this inspection:

Public Sub DoSomething(ByVal foo As Boolean)
    If foo Then
        ' ...
    End If
End Sub


Back to List