----- **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](https://github.com/DavidArno/Arnolyzer/wiki/Contributing.md). 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](http://http://davidarno.github.io/Arnolyzer/). ----- # AA1301 - Variables Should Be Assigned Once Only # **Report code: AA1301-VariablesShouldBeAssignedOnceOnly** ## Summary ##
Status Implemented
Description Variables should be treated as immutable and should not be overwritten
Category Immutability Analyzers
Enabled by default: Yes
Severity: Error
## Cause ## ## How to fix violations ## There currently aren't any implemented code-fixes for this rule. ## How to suppress violations ## This rule can be suppressed using the following attributes: **[MutableVariable]**
A method annotated with MutableVariable attribute is allowed to have variables that change value (ie canbe reassigned. The variables affected must be named in the MutableVariable attribute attribute, eg ````cs [MutableVariable attribute("var1")] public void F() { var var1 = 1; var1 = 2; } ```` Multiple variables can be supplied to the attribute, eg [MutableVariable attribute("var1", "var2")]