This rule is defined by the following Java class: net.sourceforge.pmd.rules.design.SwitchDensityRule
Example:
public class Foo { public void bar(int x) { switch (x) { case 1: { // lots of statements break; } case 2: { // lots of statements break; } } } }
This rule has the following properties:
Name | Default value | Description |
---|---|---|
minimum | 10 | The switch statement ratio reporting threshold |