Analysing FxCop / Code Analysis warning CA1506: AvoidExcessiveClassCoupling

房东的猫 提交于 2019-12-06 03:19:45

问题


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')



来源:https://stackoverflow.com/questions/4714683/analysing-fxcop-code-analysis-warning-ca1506-avoidexcessiveclasscoupling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!