-->

Analysing FxCop / Code Analysis warning CA1506: Av

2019-04-08 15:24发布

问题:

I'm getting Visual Studio Code Analysis warning CA1506 for a C# class. It says, "'FormMain' is coupled with 93 different (non-IComponent) types from 25 different namespaces. Rewrite or refactor this class's methods to decrease its class coupling, or consider moving some of the class's methods to some of the other types it is tightly coupled with. A class coupling above 95 indicates poor maintainability, a class coupling between 95 and 80 indicates moderate maintainability, and a class coupling below 80 indicates good maintainability."

My question is simply, where can I see a list of all of the types that FormMain is coupled to, so I can understand the situation better?

Thanks.

回答1:

You can use Reflector to analyze everything a class uses (right-click on the class, click 'Analyze', expand 'Depends On')