Empty While...Wend Block

Identifies empty 'While...Wend' blocks that can be safely removed.

Reasoning

Dead code should be removed. A loop without a body is usually redundant.

Default severity

Warning

Inspection type

NamingAndConventionsIssues

Examples

This example should trigger a result

MyModule (StandardModule)
Public Sub DoSomething(ByVal foo As Long) While foo < 100 'no executable statements... would be an infinite loop if entered Wend End Sub

This example should NOT trigger a result

MyModule (StandardModule)
Public Sub DoSomething(ByVal foo As Long) While foo < 100 foo = foo + 1 Wend End Sub

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