diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codesize/StdCyclomaticComplexityRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codesize/StdCyclomaticComplexityRule.java index 488671b93d..5f8efed33c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codesize/StdCyclomaticComplexityRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codesize/StdCyclomaticComplexityRule.java @@ -166,8 +166,8 @@ public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { entryStack.push( new Entry( node ) ); super.visit( node, data ); + Entry classEntry = entryStack.pop(); if ( showClassesComplexity ) { - Entry classEntry = entryStack.pop(); if ( classEntry.getComplexityAverage() >= reportLevel || classEntry.highestDecisionPoints >= reportLevel ) { addViolation( data, node, new String[] {