net.sourceforge.pmd.rules.design

Class ExcessiveNodeCountRule

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.)

Constructor Summary
ExcessiveNodeCountRule(Class nodeClass)
Method Summary
Objectvisit(SimpleJavaNode node, Object data)

Constructor Detail

ExcessiveNodeCountRule

public ExcessiveNodeCountRule(Class nodeClass)

Method Detail

visit

public Object visit(SimpleJavaNode node, Object data)