Empty Do...While Block

Identifies empty 'Do...Loop While' blocks that can be safely removed.

Reasoning

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

Default severity

Suggestion

Inspection type

NamingAndConventionsIssues

Examples

This example should trigger a result

MyModule (StandardModule)
Public Sub DoSomething(ByVal foo As Long) Do ' no executable statement... Loop While foo < 100 End Sub

This example should NOT trigger a result

MyModule (StandardModule)
Public Sub DoSomething(ByVal foo As Long) Do Debug.Print foo Loop While foo < 100 End Sub

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