Class SwitchDensityRule

  • All Implemented Interfaces:
    JavaParserVisitor, ImmutableLanguage, StatisticalRule, PropertySource, Rule

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