回复:Visual Studio2008的新功能:代码度量
类耦合在每个级别上,它表明了类对其它类型的依赖总数。这个数字不包括基类(原始类型)比如Int32,String和Object,这个数字越大,表明改动它时对其它类型的影响就越大。如果这个值比较低则表明它的代码重用的可能性越高。
下面这张图耦合值是如何被计算出来的:(译注:说白了就是没有这个类,会有几个类会挂掉。)

附件:
您所在的用户组无法下载或查看附件For example, as you can see above, Account is coupled to two other types, Address and Order, whereas Country is not dependent on any other type.
以上面的图为例Account 和两个其它类型耦合,Address 和Order,然而Country 没有依赖于任何类型。
Depth of Inheritance At the type level, depth of inheritance indicates the number of types that are above the type in the inheritance tree. For example, a type that derives directly from Object would have a depth of inheritance of 1. At the namespace and project level, this indicates the highest depth of inheritance of all the types contained within it. This number does not take into consideration the depth of any implemented interfaces. Deep inheritance trees can indicate an over-engineering of a problem and can increase the complexity of testing and maintaining an application.
继承深度 在这个度量值级别上,继承深度指这个类型在继承树上的有多少类型。例如,一个类型直接从Object上继承的话,它的深度就是1。在命名空间和项目中,它表明所有类型(包括自身)的最大的深度值。这个数字不考虑任何应用接口。深度继承树可以在维护一个应用程序表现出过度设计和增加测试复杂度的问题。
The following shows how depth is calculated:
下面展示了深度是如何被计算的:

附件:
您所在的用户组无法下载或查看附件For example, in the above inheritance hierarchy, ListControl and Label have a depth of inheritance of 3, whereas Component has a depth of inheritance of 1.
以上图的继承层次为例,ListControl 和Label 位于继承的第3层,然而Component 的深度为1.