When increasing nesting level we always get structure and nesting complexity

This commit is contained in:
Gwilym Kuiper
2020-02-18 14:08:44 +00:00
parent 50d2bcb7f1
commit 7d3a5ef7f4

View File

@ -23,6 +23,8 @@ public class CognitiveComplexityVisitor extends ApexParserVisitorAdapter {
}
void increaseNestingLevel() {
structureComplexity();
nestingComplexity();
nestingLevel++;
}
@ -42,8 +44,6 @@ public class CognitiveComplexityVisitor extends ApexParserVisitorAdapter {
break;
}
state.structureComplexity();
state.nestingComplexity();
state.increaseNestingLevel();
super.visit(child, data);
state.decreaseNestingLevel();
@ -56,8 +56,6 @@ public class CognitiveComplexityVisitor extends ApexParserVisitorAdapter {
public Object visit(ASTForLoopStatement node, Object data) {
State state = (State) data;
state.structureComplexity();
state.nestingComplexity();
state.increaseNestingLevel();
super.visit(node, data);
state.decreaseNestingLevel();