DataAbstractionCoupling reports coupling classes, contributed by Benoit Xhenseval (request 990055)
This commit is contained in:
parent
3b5e5d728b
commit
8ab17acbc6
|
|
@ -103,6 +103,10 @@ checkstyle-user</a>).</li>
|
|||
contributed by Pierre Dittgen
|
||||
(request 978916).</li>
|
||||
|
||||
<li class="body">DataAbstractionCoupling reports coupling classes,
|
||||
contributed by Benoit Xhenseval
|
||||
(request 990055).</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p class="body">
|
||||
|
|
|
|||
|
|
@ -285,8 +285,10 @@ public abstract class AbstractClassCouplingCheck extends Check
|
|||
|
||||
if (mReferencedClassNames.size() > mMax) {
|
||||
log(mLineNo, mColumnNo, getLogMessageId(),
|
||||
new Integer(mReferencedClassNames.size()),
|
||||
new Integer(getMax()));
|
||||
new Object[] {
|
||||
new Integer(mReferencedClassNames.size()),
|
||||
new Integer(getMax()),
|
||||
mReferencedClassNames.toString(), });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
booleanExpressionComplexity=Boolean expression complexity is {0,number,integer} (max allowed is {1,number,integer}).
|
||||
classDataAbstractionCoupling=Class Data Abstraction Coupling is {0,number,integer} (max allowed is {1,number,integer}).
|
||||
classDataAbstractionCoupling=Class Data Abstraction Coupling is {0,number,integer} (max allowed is {1,number,integer}) classes {2}.
|
||||
classFanOutComplexity=Class Fan-Out Complexity is {0,number,integer} (max allowed is {1,number,integer}).
|
||||
cyclomaticComplexity=Cyclomatic Complexity is {0,number,integer} (max allowed is {1,number,integer}).
|
||||
duplicateLiteral=Duplicate instances of literal ''{0}'' are not allowed.
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ public class ClassDataAbstractionCouplingCheckTest extends BaseCheckTestCase
|
|||
checkConfig.addAttribute("max", "0");
|
||||
|
||||
String[] expected = {
|
||||
"6:1: Class Data Abstraction Coupling is 4 (max allowed is 0).",
|
||||
"7:5: Class Data Abstraction Coupling is 1 (max allowed is 0).",
|
||||
"6:1: Class Data Abstraction Coupling is 4 (max allowed is 0) classes [AnotherInnerClass, InnerClass, HashSet, HashMap].",
|
||||
"7:5: Class Data Abstraction Coupling is 1 (max allowed is 0) classes [ArrayList].",
|
||||
};
|
||||
|
||||
verify(checkConfig,
|
||||
|
|
|
|||
Loading…
Reference in New Issue