试析的FxCop /代码分析警告CA1506:AvoidExcessiveClassCoupling [英] Analysing FxCop / Code Analysis warning CA1506: AvoidExcessiveClassCoupling

查看:361
本文介绍了试析的FxCop /代码分析警告CA1506:AvoidExcessiveClassCoupling的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到的Visual Studio代码分析警告CA1506为C#类。它说,'FormMain'是加上93个不同的(非IComponent的)来自25个不同的命名空间类型。重写或重构这个类的方法来降低其类耦合,或考虑将一些类的方法的一些其他类型的吧紧密结合。95以上的一类耦合表示可维护性差,95和80之间的一类耦合显示适度的可维护性,以下80类耦合表示可维护性好。

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."

我的问题很简单,我在这里可以看到所有FormMain耦合到类型的列表,这样我就可以了解的情况更好?

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?

感谢。

推荐答案

您可以使用的反射来分析一切类使用(在类单击鼠标右键,单击分析,扩大取决于')

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

这篇关于试析的FxCop /代码分析警告CA1506:AvoidExcessiveClassCoupling的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆