Redundant ByRef Modifier

Identifies redundant ByRef modifiers.

Reasoning

Out of convention or preference, explicit ByRef modifiers could be considered redundant since they are the implicit default. This inspection can ensure the consistency of the convention.

Default severity

DoNotShow

Inspection type

CodeQualityIssues

Examples

This example should trigger a result

MyModule (StandardModule)
Option Explicit Public Sub DoSomething(ByRef foo As Long) foo = foo + 17 Debug.Print foo End Sub

This example should NOT trigger a result

MyModule (StandardModule)
Option Explicit Public Sub DoSomething(foo As Long) foo = foo + 17 Debug.Print foo End Sub

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