Step One is Redundant

Locates 'For' loops where the 'Step' token is specified with the default increment value (1).

 NEW! This inspection is only available in pre-release builds.

Reasoning

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

Default severity

Hint

Inspection type

LanguageOpportunities

QuickFixes

The following quickfixes are available for this inspection:

Examples

This example should trigger a result

MyModule (StandardModule)
Public Sub DoSomething() Dim i As Long For i = 1 To 100 Step 1 ' 1 being the implicit default, 'Step 1' could be considered redundant. ' ... Next End Sub

This example should NOT trigger a result

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

Rubberduck.CodeAnalysis.Inspections.Concrete.StepOneIsRedundantInspection.cs (Prerelease-v2.5.2.6174)