Fix for 1501: CyclomaticComplexity rule causes OOM when class reporting is disabled

This commit is contained in:
Frits Jalvingh
2016-07-04 08:51:27 +02:00
committed by Andreas Dangel
parent 553cafff6e
commit afc0f25795

View File

@ -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[] {