CA1506: Avoid excessive class coupling


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at CA1506: Avoid excessive class coupling.

|Breaking Change|Breaking|

A type or method is coupled with many other types.

This rule measures class coupling by counting the number of unique type references that a type or method contains.

Types and methods that have a high degree of class coupling can be difficult to maintain. It is a good practice to have types and methods that exhibit low coupling and high cohesion.

To fix this violation, try to redesign the type or method to reduce the number of types to which it is coupled.

Exclude this warning when the type or method is still considered maintainable despite its large number of dependencies on other types.

Maintainability Warnings
Measuring Complexity and Maintainability of Managed Code