Step is Not Specified

Locates 'For' loops where the 'Step' token is omitted.

Reasoning

Out of convention or preference, explicit 'Step' specifiers could be considered mandatory; this inspection can ensure the consistency of the convention.

Default severity

DoNotShow

Inspection type

LanguageOpportunities

Examples

This example should trigger a result

MyModule (StandardModule)
Public Sub DoSomething() Dim i As Long For i = 1 To 100 ' Step is implicitly 1 ' ... Next End Sub

This example should NOT trigger a result

MyModule (StandardModule)
Public Sub DoSomething() Dim i As Long For i = 1 To 100 Step 1 ' explicit 'Step 1' could also be considered redundant. ' ... Next End Sub

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