net.sourceforge.pmd.rules.design

Class SwitchDensityRule

public class SwitchDensityRule extends StatisticalRule

Author: dpeugh

Switch Density - This is the number of statements over the number of cases within a switch. The higher the value, the more work each case is doing.

Its my theory, that when the Switch Density is high, you should start looking at Subclasses or State Pattern to alleviate the problem.

Method Summary
Objectvisit(ASTSwitchStatement node, Object data)
Objectvisit(ASTStatement statement, Object data)
Objectvisit(ASTSwitchLabel switchLabel, Object data)

Method Detail

visit

public Object visit(ASTSwitchStatement node, Object data)

visit

public Object visit(ASTStatement statement, Object data)

visit

public Object visit(ASTSwitchLabel switchLabel, Object data)