-
Notifications
You must be signed in to change notification settings - Fork 4
AA1300ParametersShouldNotBeModified
Warning: this wiki page is auto-generated by the Arnolyzer solution-build process. Do not directly edit this page, as your changes will be lost on the next commit. To edit this page, please refer to Contributing to this project.
These wiki pages reflect the state of the project in development, per the last commit. For details of the latest release of the Arnolyzer Analysers, please see the Arnolyzer website.
Report code: AA1300-ParametersShouldNotBeModified
Status | Implemented |
Description | Parameters should be treated as immutable and not used as a mutable variables |
Category | Immutability Analyzers |
Enabled by default: | Yes |
Severity: | Error |
There currently aren't any implemented code-fixes for this rule.
This rule can be suppressed using the following attributes:
[MutableParameter]
A method annotated with MutableParameter attribute is allowed to have parameters that change value (ie canbe reassigned. The parameters affected must be named in the MutableParameter attribute attribute, eg
[MutableParameter attribute("p1")]
public void F(int p1, int p2)
{
p1 = 1;
p2 = 2;
}
would result in no errors over the reassignment of p1
.
Multiple variables can be supplied to the attribute, eg [MutableParameter attribute("p1", "p2")]