You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the code below:
The number of control variables is 7, and the number of comparisons is 4. I am wondering if that's correct. For example, SCOPE is considered only as one control variable, although it has four different values in the code. Likewise, Condition like if (mCheckDefaultMethods) is not considered as a comparison.
private void checkCounters(DetailAST aAst)
{
final MethodCounter actualCounter = mCounters.peek();
if (mCheckDefaultMethods) {
if (actualCounter.value(Scope.PACKAGE) > mMax) {
log(aAst.getLineNo(), "too.many.defaultMethods",
actualCounter.value(Scope.PACKAGE), mMax);
}
}
if (mCheckPrivateMethods) {
if (actualCounter.value(Scope.PRIVATE) > mMax) {
log(aAst.getLineNo(), "too.many.privateMethods",
actualCounter.value(Scope.PRIVATE), mMax);
}
}
if (mCheckProtectedMethods) {
if (actualCounter.value(Scope.PROTECTED) > mMax) {
log(aAst.getLineNo(), "too.many.protectedMethods",
actualCounter.value(Scope.PROTECTED), mMax);
}
}
if (mCheckPublicMethods) {
if (actualCounter.value(Scope.PUBLIC) > mMax) {
log(aAst.getLineNo(), "too.many.publicMethods",
actualCounter.value(Scope.PUBLIC), mMax);
}
}
}
The text was updated successfully, but these errors were encountered:
Thanks for the reply. Also, I am confused the way you are calculating the number of comparisons. I can not find a real definition anywhere that clearly says what it is. For example, if(a>b and b<c), do we have one or two comparisons here?
For the code below:
The number of control variables is 7, and the number of comparisons is 4. I am wondering if that's correct. For example, SCOPE is considered only as one control variable, although it has four different values in the code. Likewise, Condition like if (mCheckDefaultMethods) is not considered as a comparison.
private void checkCounters(DetailAST aAst)
{
final MethodCounter actualCounter = mCounters.peek();
if (mCheckDefaultMethods) {
if (actualCounter.value(Scope.PACKAGE) > mMax) {
log(aAst.getLineNo(), "too.many.defaultMethods",
actualCounter.value(Scope.PACKAGE), mMax);
}
}
if (mCheckPrivateMethods) {
if (actualCounter.value(Scope.PRIVATE) > mMax) {
log(aAst.getLineNo(), "too.many.privateMethods",
actualCounter.value(Scope.PRIVATE), mMax);
}
}
if (mCheckProtectedMethods) {
if (actualCounter.value(Scope.PROTECTED) > mMax) {
log(aAst.getLineNo(), "too.many.protectedMethods",
actualCounter.value(Scope.PROTECTED), mMax);
}
}
if (mCheckPublicMethods) {
if (actualCounter.value(Scope.PUBLIC) > mMax) {
log(aAst.getLineNo(), "too.many.publicMethods",
actualCounter.value(Scope.PUBLIC), mMax);
}
}
}
The text was updated successfully, but these errors were encountered: