Since: PMD 5.0
Denotes whether comments are required (or unwanted) for specific language elements.
This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.comments.CommentRequiredRule
Example(s):/** * * * @author George Bush */
This rule has the following properties:
Name | Default Value | Description |
---|---|---|
violationSuppressRegex | Suppress violations with messages matching a regular expression | |
violationSuppressXPath | Suppress violations on nodes which match a given relative XPath expression. | |
protectedMethodCommentRequirement | Required | Protected method comments |
publicMethodCommentRequirement | Required | Public method comments |
fieldCommentRequirement | Required | Field comments |
headerCommentRequirement | Required | Header comments |
Since: PMD 5.0
Determines whether the dimensions of non-header comments found are within the specified limits.
This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.comments.CommentSizeRule
Example(s):/** * * too many lines! * * * * * * * * * * * * */
This rule has the following properties:
Name | Default Value | Description |
---|---|---|
violationSuppressRegex | Suppress violations with messages matching a regular expression | |
violationSuppressXPath | Suppress violations on nodes which match a given relative XPath expression. | |
maxLines | 6 | Maximum lines |
maxLineLength | 80 | Maximum line length |
Since: PMD 5.0
A rule for the politically correct... we don't want to offend anyone.
This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.comments.CommentContentRule
Example(s):// OMG, this is horrible, Bob is an idiot !!!
This rule has the following properties:
Name | Default Value | Description |
---|---|---|
violationSuppressRegex | Suppress violations with messages matching a regular expression | |
violationSuppressXPath | Suppress violations on nodes which match a given relative XPath expression. | |
disallowedTerms | [idiot, jerk] | Illegal terms or phrases |
caseSensitive | false | Case sensitive |
wordsAreRegex | false | Use regular expressions |