Rules that help you discover design issues.
Edit me

AvoidDeeplyNestedIfStmts

Since: PMD 5.1

Priority: Medium (3)

Avoid creating deeply nested if-then statements since they are harder to read and error-prone to maintain.

This rule is defined by the following Java class: net.sourceforge.pmd.lang.vm.rule.design.AvoidDeeplyNestedIfStmtsRule

This rule has the following properties:

Name Default Value Description
problemDepth 3 The if statement depth reporting threshold

Use this rule by referencing it:

<rule ref="category/vm/design.xml/AvoidDeeplyNestedIfStmts" />

CollapsibleIfStatements

Since: PMD 5.1

Priority: Medium (3)

Sometimes two consecutive ‘if’ statements can be consolidated by separating their conditions with a boolean short-circuit operator.

This rule is defined by the following Java class: net.sourceforge.pmd.lang.vm.rule.design.CollapsibleIfStatementsRule

Use this rule by referencing it:

<rule ref="category/vm/design.xml/CollapsibleIfStatements" />

ExcessiveTemplateLength

Since: PMD 5.1

Priority: Medium (3)

The template is too long. It should be broken up into smaller pieces.

This rule is defined by the following Java class: net.sourceforge.pmd.lang.vm.rule.design.ExcessiveTemplateLengthRule

This rule has the following properties:

Name Default Value Description
topscore   Top score value
minimum   Minimum reporting threshold
sigma   Sigma value

Use this rule by referencing it:

<rule ref="category/vm/design.xml/ExcessiveTemplateLength" />

NoInlineJavaScript

Since: PMD 5.1

Priority: Medium High (2)

Avoid inline JavaScript. Import .js files instead.

This rule is defined by the following Java class: net.sourceforge.pmd.lang.vm.rule.design.NoInlineJavaScriptRule

Use this rule by referencing it:

<rule ref="category/vm/design.xml/NoInlineJavaScript" />

NoInlineStyles

Since: PMD 5.1

Priority: Medium High (2)

Avoid inline styles. Use css classes instead.

//Text[matches(@literal, "<[^>]+\s[sS][tT][yY][lL][eE]\s*=")]

Use this rule by referencing it:

<rule ref="category/vm/design.xml/NoInlineStyles" />