Fork me on GitHub

PMD Rulesets index: Current Rulesets

List of rulesets and rules contained in each ruleset.

  • Basic POM: The Basic POM Ruleset contains a collection of good practices regarding Maven’s POM files.
  • Basic XML: The Basic XML Ruleset contains a collection of good practices which everyone should follow.
  • XPath in XSL: This ruleset regroups a collection of good practices regarding XPath querying and functions inside an XSL.

Basic POM (pom)

  • ProjectVersionAsDependencyVersion: Using that expression in dependency declarations seems like a shortcut, but it can go wrong. By far the most common problem is the use of${project.version} in a BOM or parent POM.
  • InvalidDependencyTypes: While Maven will not failed if you use an invalid type for a dependency in the dependency management section, it will not also uses the dependency.

Basic XML (xml)

  • MistypedCDATASection: An XML CDATA section begins with a <!CDATA[ marker, which has only one [, and ends with a ]]> marker, which has only two ].

XPath in XSL (xsl)

  • UseConcatOnce: The XPath concat() functions accepts as many arguments as required so you can have “concat($a,‘b’,$c)” rather than “concat($a,concat(‘b’,$c)”.
  • AvoidAxisNavigation: Avoid using the ‘following’ or ‘preceeding’ axes whenever possible, as these can cut through 100% of the document in the worst case. Also, try to avoid using ‘descendant’ or ‘descendant-self’ axes, as if you’re at the top of the Document, it necessarily means cutting through 100% of the document.