----- **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/). ----- # AA1101 - Class Properties Should Be Publicly Read-Only # **Report code: AA1101-ClassPropertiesShouldBePubliclyReadOnly** ## Summary ##
Status Implemented
Description Public classes should not provide publicly accessible setters for properties
Category Encapsulation Analyzers
Enabled by default: Yes
Severity: Error
## Cause ## Class properties should not have public setters. Properties with public setters become mutable from any other point in the code that has access to the object instance, making it much harder to track changes to the object's state. ## 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: **[MutableProperty]**
A public setter may sometimes be required. It is therefore allowed if decorated with the MutableProperty attribute as it explicitly asserts the need for the property to be mutable.