Assigned ByVal Parameter
Warns about parameters passed by value being assigned a new value in the body of a procedure.
Reasoning
Debugging is easier if the procedure's initial state is preserved and accessible anywhere within its scope. Mutating the inputs destroys the initial state, and makes the intent ambiguous: if the calling code is meant to be able to access the modified values, then the parameter should be passed ByRef; the ByVal modifier might be a bug.
Default severity
Warning
Inspection type
CodeQualityIssues
Examples
This example should trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.AssignedByValParameterInspection.cs (Prerelease-v2.5.9.6289)