Parameter Can Be ByVal
Flags parameters that are passed by reference (ByRef), but could be passed by value (ByVal).
Remarks
For performance reasons, this inspection will not flag a parameter that is passed as an argument to a procedure that also accepts it ByRef.
Reasoning
Explicitly specifying a ByVal modifier on a parameter makes the intent explicit: this parameter is not meant to be assigned. In contrast, a parameter that is passed by reference (implicitly, or explicitly ByRef) makes it ambiguous from the calling code's standpoint, whether the procedure might re-assign these ByRef values and introduce a bug.
Default severity
Suggestion
Inspection type
NamingAndConventionsIssues
Examples
This example should trigger a result
This example should NOT trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.ParameterCanBeByValInspection.cs (Prerelease-v2.5.9.6289)