org.acm.seguin.pmd.rules.design
Class ExcessiveNodeCountRule

java.lang.Object
  extended by net.sourceforge.jrefactory.parser.JavaParserVisitorAdapter
      extended by org.acm.seguin.pmd.AbstractRule
          extended by org.acm.seguin.pmd.stat.StatisticalRule
              extended by org.acm.seguin.pmd.rules.design.ExcessiveNodeCountRule
All Implemented Interfaces:
net.sourceforge.jrefactory.parser.JavaParserVisitor, Rule
Direct Known Subclasses:
ExcessiveImportsRule, ExcessivePublicCountRule, LongParameterListRule

public class ExcessiveNodeCountRule
extends StatisticalRule

This is a common super class for things which shouldn't have excessive nodes underneath. It expects all "visit" calls to return an Integer. It will sum all the values it gets, and use that as its score. To use it, override the "visit" for the nodes that need to be counted. On those return "new Integer(1)" All others will return 0 (or the sum of counted nodes underneath.)


Field Summary
 
Fields inherited from class org.acm.seguin.pmd.stat.StatisticalRule
DELTA
 
Fields inherited from interface org.acm.seguin.pmd.Rule
LOWEST_PRIORITY, PRIORITIES
 
Constructor Summary
ExcessiveNodeCountRule(java.lang.Class nodeClass)
           
 
Method Summary
 java.lang.Object visit(net.sourceforge.jrefactory.ast.SimpleNode node, java.lang.Object data)
          To visit a node
 
Methods inherited from class org.acm.seguin.pmd.stat.StatisticalRule
addDataPoint, apply, applyMinimumValue, applyTopScore, getMean, getStdDev, makeViolations
 
Methods inherited from class org.acm.seguin.pmd.AbstractRule
addProperty, createRuleViolation, createRuleViolation, equals, getBooleanProperty, getDescription, getDoubleProperty, getExample, getIntProperty, getMessage, getName, getPriority, getPriorityName, getProperties, getStringProperty, hashCode, hasProperty, include, setDescription, setExample, setInclude, setMessage, setName, setPriority, visit, visitAll
 
Methods inherited from class net.sourceforge.jrefactory.parser.JavaParserVisitorAdapter
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcessiveNodeCountRule

public ExcessiveNodeCountRule(java.lang.Class nodeClass)
Method Detail

visit

public java.lang.Object visit(net.sourceforge.jrefactory.ast.SimpleNode node,
                              java.lang.Object data)
Description copied from class: net.sourceforge.jrefactory.parser.JavaParserVisitorAdapter
To visit a node

Specified by:
visit in interface net.sourceforge.jrefactory.parser.JavaParserVisitor
Overrides:
visit in class net.sourceforge.jrefactory.parser.JavaParserVisitorAdapter
Parameters:
node - The node we are visiting
data - The rename type data
Returns:
The rename type data