Hi,
I am using your plugin with version 1.3.6. Please have a look at the following two methods and their javadoc-comments:
/**
* Eclipse Metrics reports a McCabe complexity of 2 for this method.
* @param tokens
*/
public final void iterateComplex(final List<String> tokens) {
if (tokens == null) {
return;
}
for (final String eachToken : tokens) {
if (eachToken != null && !"".equals(eachToken.trim())) {
System.out.println(eachToken);
}
}
return;
}
/**
* Eclipse Metrics reports a McCabe complexity of 4 for this method.
* @param token
*/
public final void donNotIterate(final String token) {
if (token == null) {
return;
}
if (token != null && !"".equals(token.trim())) {
System.out.println(token);
}
return;
}
McCabe complexity of 2 for method iterateComplex(final List<String> tokens) is not what I would expect. As far as I understand it should have a value of 5. One more than donNotIterate() because of the additional for-loop.
Is this a bug or am I missing something?
Best regards
Jan
I have the same problem with this code:
I get 1 but the real complexity is 5.
Regards