CA1505: Avoid unmaintainable code
TypeName | AvoidUnmantainableCode |
CheckId | CA1505 |
Category | Microsoft.Maintainability |
Breaking Change | Non-breaking |
The maintainability index is calculated by using the following metrics: lines of code, program volume, and cyclomatic complexity. Program volume is a measure of the difficulty of understanding of a type or method that is based on the number of operators and operands in the code. Cyclomatic complexity is a measure of the structural complexity of the type or method. You can learn more about code metrics at Measuring Complexity and Maintainability of Managed Code.
A low maintainability index indicates that a type or method is probably difficult to maintain and would be a good candidate to redesign.
Supressing does not work well
When I use a right-click on an error message to suppress this, it is suppressed for the entire class, which seems silly.
I tried to suppress it just for a method, without success, as follows: [method: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Justification = "Obvious system")] immediately before the method - why does that not work?
Some examples would help here.
I tried to suppress it just for a method, without success, as follows: [method: SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Justification = "Obvious system")] immediately before the method - why does that not work?
Some examples would help here.