Class SwitchDensityRule

  • All Implemented Interfaces:
    AstVisitor, JavaVisitor, Rule, PropertySource

    public class SwitchDensityRule
    extends AbstractJavaRulechainRule
    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.

    Author:
    David Dixon-Peugh, Clément Fournier