Empty If...End If Block

Identifies empty 'If' blocks.

Reasoning

Conditional expression is inverted; there would not be a need for an 'Else' block otherwise.

Default severity

Warning

Inspection type

NamingAndConventionsIssues

Examples

This example should trigger a result

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

This example should NOT trigger a result

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

Rubberduck.CodeAnalysis.Inspections.Concrete.EmptyIfBlockInspection.cs (Prerelease-v2.5.9.6289)