Arnolyzer is a Roslyn-based C# code analyzer that aims to provide a set of rules that encourage modern, functional-orientated, coding standards in C#. Pure functions; no inheritance; no global state; adherence to SOLID principles; immutable variables; and short, concise sections of code.
Current Release - 1.1.0
The current release of Arnolyzer is 1.1.0, which is available as a nuget package.
That release included the following: Modification of the analyzer names to include a code for each. This then linked in with the documentation pages.
The aim is to improve the discoverability of the analyzers for search engines, with the hope that clicking on an error in Visual Studio will take the developer to the documentation for that analyzer.
For more details of that release, previous releases, how to install Arnolyzer and documentation for the analyzers in the current release, please refer to the Arnolyzer website.
Current state of development
Currently, version 1.2.0 is in development. This is subject to change without warning though, should eg an urgent bug fix release be needed in the meantime.
Last code commit: 03 Oct 2016.
The following documentation is a summary of the Arnolyzer project (analyzers so far implemented, and what's planned), as of the last code commit. Note, this may be different to what's in the 1.1.0 release, as the code base will likely contain unreleased changes. Please refer to the Arnolyzer website for details of what's in the current release.
For detailed instructions on how to install and configure the Arnolyzer analyzers, please refer to the installation guide.
For details on how to contribute to the Analyzer Analyzers project, please refer to Contributing to this project.
The Arnolyzer analyzers are grouped by category. For details on each category, the thinking behind why following the rules of each category is a good idea, and the analyzers that enforce these rules, see:
- Encapsulation Analyzers
- Global State Analyzers
- Immutability Analyzers
- Liskov Substitution Principle Analyzers
- Pure-Function Analyzers
- Single Responsibilty Analyzers
Thus far, the analyzers implemented are:
- AA1000 - Static Methods Should Not Be Void
- AA1001 - Static Methods Should Have At Least One Parameter
Global State Analyzers
- AA1100 - Interface Properties Should Be Read-Only
- AA1101 - Class Properties Should Be Publicly Read-Only
- AA1102 - Inner Types Must Be Private
Liskov Substitution Principle Analyzers
Single Responsibilty Analyzers
- AA2100 - Method Parameters Must Not Be Ref Or Out
- AA2103 - Method Should Not Contain And
- AA2104 - File Must Only Contain One Type Definition
For details of each of these, please follow the respective links.
The following analyzers are planned for future releases of Arnolyzer, but haven't yet been implemented:
Single Responsibilty Analyzers
In addition to this list of planned analyzers, there are two key areas of further work planned:
- There are situations where the code needs to violate some of these rules and so a means to suppress the rule is needed. This will be achieved via attributes. So far, very few rules take advantage of this.
- The are situations where simple code fixes can be offered to fix violations. This area of work hasn't been started at all, yet.