Merge branch 'master' into 7.0.x

This commit is contained in:
Clément Fournier
2019-04-01 02:02:04 +02:00
185 changed files with 5358 additions and 873 deletions

View File

@ -71,10 +71,10 @@ elif travis_isPush; then
echo -e "\n\n"
log_info "This is a release build for tag ${TRAVIS_TAG}"
echo -e "\n\n"
./mvnw deploy -Possrh,pmd-release $MVN_BUILD_FLAGS
./mvnw deploy -Possrh,sign,pmd-release $MVN_BUILD_FLAGS
elif [[ "${VERSION}" == *-SNAPSHOT ]]; then
log_info "This is a snapshot build"
./mvnw deploy -Possrh $MVN_BUILD_FLAGS
./mvnw deploy -Possrh,sign $MVN_BUILD_FLAGS
push_docs
else
# other build. Can happen during release: the commit with a non snapshot version is built, but not from the tag.

Binary file not shown.

View File

@ -6,13 +6,13 @@ if [ "${TRAVIS_REPO_SLUG}" != "pmd/pmd" ] || [ "${TRAVIS_PULL_REQUEST}" != "fals
echo " TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG}"
echo " TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}"
echo " TRAVIS_SECURE_ENV_VARS=${TRAVIS_SECURE_ENV_VARS}"
[ "${encrypted_5630fbebf057_iv}" = "" ] && echo " Variable encrypted_5630fbebf057_iv is not set"
[ "${encrypted_c422865a395e_iv}" = "" ] && echo " Variable encrypted_c422865a395e_iv is not set"
exit 0
fi
echo "Setting up secrets..."
openssl aes-256-cbc -K ${encrypted_5630fbebf057_key} -iv ${encrypted_5630fbebf057_iv} -in .travis/secrets.tar.enc -out .travis/secrets.tar -d
openssl aes-256-cbc -K ${encrypted_c422865a395e_key} -iv ${encrypted_c422865a395e_iv} -in .travis/secrets.tar.enc -out .travis/secrets.tar -d
pushd .travis && tar xfv secrets.tar && popd
mkdir -p "$HOME/.ssh"
chmod 700 "$HOME/.ssh"

View File

@ -75,12 +75,15 @@ echo
echo "* Ensure all the new rules are listed in the proper file:"
echo " ${RELEASE_RULESET}"
echo
echo "* Update **pmd-apex/src/main/resources/rulesets/apex/quickstart.xml** and"
echo " **pmd-java/src/main/resources/rulesets/java/quickstart.xml** with the new rules."
echo
echo "* Update **docs/pages/next_major_development.md** with the API changes for"
echo " the new release based on the release notes"
echo
echo "* Update **../pmd.github.io/_config.yml** to mention the new release"
echo
echo "* Update property `pmd-designer.version` in **pom.xml** to reference the latest pmd-designer release"
echo "* Update property \`pmd-designer.version\` in **pom.xml** to reference the latest pmd-designer release"
echo " See <https://search.maven.org/search?q=g:net.sourceforge.pmd%20AND%20a:pmd-ui&core=gav> for the available releases."
echo
echo "Press enter to continue..."

View File

@ -1,9 +1,9 @@
repository: pmd/pmd
pmd:
version: 6.13.0
previous_version: 6.12.0
date: ??-March-2019
version: 6.14.0
previous_version: 6.13.0
date: ??-April-2019
release_type: minor
output: web

View File

@ -73,6 +73,26 @@ the breaking API changes will be performed in 7.0.0.
an API is tagged as `@Deprecated` or not in the latest minor release. During the development of 7.0.0,
we may decide to remove some APIs that were not tagged as deprecated, though we'll try to avoid it." %}
#### 6.13.0
##### Command Line Interface
The start scripts `run.sh`, `pmd.bat` and `cpd.bat` support the new environment variable `PMD_JAVA_OPTS`.
This can be used to set arbitrary JVM options for running PMD, such as memory settings (e.g. `PMD_JAVA_OPTS=-Xmx512m`)
or enable preview language features (e.g. `PMD_JAVA_OPTS=--enable-preview`).
The previously available variables such as `OPTS` or `HEAPSIZE` are deprecated and will be removed with PMD 7.0.0.
##### Deprecated API
* {% jdoc core::renderers.CodeClimateRule %} is deprecated in 7.0.0 because it was unused for 2 years and
created an unwanted dependency.
Properties "cc_categories", "cc_remediation_points_multiplier", "cc_block_highlighting" will also be removed.
See [#1702](https://github.com/pmd/pmd/pull/1702) for more.
* The Apex ruleset `rulesets/apex/ruleset.xml` has been deprecated and will be removed in 7.0.0. Please use the new
quickstart ruleset `rulesets/apex/quickstart.xml` instead.
#### 6.12.0
No changes.

View File

@ -3,21 +3,68 @@ title: How to add a new CPD language
short_title: Add a new CPD language
tags: [devdocs, extending]
summary: How to add a new CPD language
last_updated: July 3, 2016
last_updated: March 18, 2019 (6.13.0)
permalink: pmd_devdocs_major_adding_new_cpd_language.html
author: Romain PELISSE <belaran@gmail.com>
author: Matías Fraga <fragamati@gmail.com>
---
If you wish CPD to parse a unsupported language, you can easily develop a new parser for CPD. All you need to is implements the following interface:
First of all, thanks for the contribution!
* net.sourceforge.pmd.cpd.Language
* net.sourceforge.pmd.cpd.Tokenizer
Happily for you, to add CPD support for a new language is now easier than ever!
Do not forget to the follow the proper naming convention, as the CPD parser factory use this convention:
{% include callout.html content="**Pro Tip**: If you wish to add a new language, there are more than 50 languages you could easily add with just an [Antlr grammar](https://github.com/antlr/grammars-v4)." type="primary" %}
* Language Name + "Language"
* Tokenizer Name + "Tokenizer"
All you need to do is follow this few steps:
For instance, if you develop a python parser, you should have two classes named PythonLanguage and PythonTokenizer.
1. Create a new module for your language, you can take [GO as an example](https://github.com/pmd/pmd/tree/master/pmd-go)
2. Create a Tokenizer
- For Antlr grammars you can take the grammar from [here](https://github.com/antlr/grammars-v4) and extend [AntlrTokenizer](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cpd/AntlrTokenizer.java) taking Go as an example
```java
public class GoTokenizer extends AntlrTokenizer {
@Override protected AntlrTokenManager getLexerForSource(SourceCode sourceCode) {
CharStream charStream = AntlrTokenizer.getCharStreamFromSourceCode(sourceCode);
return new AntlrTokenManager(new GolangLexer(charStream), sourceCode.getFileName());
}
}
```
- For JavaCC grammars you should subclass [JavaCCTokenizer](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/JavaCCTokenizer.java) wich has many examples you could follow, you should also take the [Python implementation](https://github.com/pmd/pmd/blob/master/pmd-python/src/main/java/net/sourceforge/pmd/cpd/PythonTokenizer.java) as reference
- For any other scenario you can use [AnyTokenizer](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cpd/AnyTokenizer.java)
To test your parser, just package it in a jar and add your jar to the classpath.
3. Create your [Language](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java) class
```java
public class GoLanguage extends AbstractLanguage {
public GoLanguage() {
super("Go", "go", new GoTokenizer(), ".go");
}
}
```
{% include callout.html content="**Pro Tip**: Yes, keep looking at Go!" type="primary" %}
**You are almost there!**
4. Please don't forget to add some test, you can again.. look at Go implementation ;)
If you read this far, I'm keen to think you would also love to support some extra CPD configuration (ignore imports or crazy things like that)
If that's your case , you came to the right place!
5. You can add your custom properties using a Token filter
- For Antlr grammars all you need to do is implement your own [AntlrTokenFilter](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cpd/token/AntlrTokenFilter.java)
And by now, I know where you are going to look...
**WRONG**
Why do you want GO to solve all your problems?
You should take a look to [Kotlin token filter implementation](https://github.com/pmd/pmd/blob/master/pmd-kotlin/src/main/java/net/sourceforge/pmd/cpd/KotlinTokenizer.java)
- For non-Antlr grammars you can use [BaseTokenFilter](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cpd/token/internal/BaseTokenFilter.java) directly or take a peek to [Java's token filter](https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/cpd/JavaTokenizer.java)

View File

@ -42,6 +42,10 @@ The release notes usual mention any new rules that have been added since the las
Please double check the file `pmd-core/src/main/resources/rulesets/releases/<version>.xml`, so
that all new rules are listed.
Add the new rules as comments to the quickstart rulesets:
* `pmd-apex/src/main/resources/rulesets/apex/quickstart.xml`
* `pmd-java/src/main/resources/rulesets/java/quickstart.xml`
We maintain a documentation for the [next major release](pmd_next_major_development.html). Copy the API
changes from the current release notes to this document: `docs/pages/next_major_development.md`.

View File

@ -11,7 +11,9 @@ folder: pmd/rules
{% include callout.html content="Rules which enforce generally accepted best practices." %}
* [ApexAssertionsShouldIncludeMessage](pmd_rules_apex_bestpractices.html#apexassertionsshouldincludemessage): The second parameter of System.assert/third parameter of System.assertEquals/System.assertNotEqua...
* [ApexUnitTestClassShouldHaveAsserts](pmd_rules_apex_bestpractices.html#apexunittestclassshouldhaveasserts): Apex unit tests should include at least one assertion. This makes the tests more robust, and usi...
* [ApexUnitTestMethodShouldHaveIsTestAnnotation](pmd_rules_apex_bestpractices.html#apexunittestmethodshouldhaveistestannotation): Apex test methods should have @isTest annotation.As testMethod keyword is deprecated, Salesforce ...
* [ApexUnitTestShouldNotUseSeeAllDataTrue](pmd_rules_apex_bestpractices.html#apexunittestshouldnotuseseealldatatrue): Apex unit tests should not use @isTest(seeAllData=true) because it opens up the existing database...
* [AvoidGlobalModifier](pmd_rules_apex_bestpractices.html#avoidglobalmodifier): Global classes should be avoided (especially in managed packages) as they can never be deleted or...
* [AvoidLogicInTrigger](pmd_rules_apex_bestpractices.html#avoidlogicintrigger): As triggers do not allow methods like regular classes they are less flexible and suited to apply ...

View File

@ -5,10 +5,50 @@ permalink: pmd_rules_apex_bestpractices.html
folder: pmd/rules/apex
sidebaractiveurl: /pmd_rules_apex.html
editmepath: ../pmd-apex/src/main/resources/category/apex/bestpractices.xml
keywords: Best Practices, ApexUnitTestClassShouldHaveAsserts, ApexUnitTestShouldNotUseSeeAllDataTrue, AvoidGlobalModifier, AvoidLogicInTrigger
keywords: Best Practices, ApexAssertionsShouldIncludeMessage, ApexUnitTestClassShouldHaveAsserts, ApexUnitTestMethodShouldHaveIsTestAnnotation, ApexUnitTestShouldNotUseSeeAllDataTrue, AvoidGlobalModifier, AvoidLogicInTrigger
language: Apex
---
<!-- DO NOT EDIT THIS FILE. This file is generated from file ../pmd-apex/src/main/resources/category/apex/bestpractices.xml. -->
## ApexAssertionsShouldIncludeMessage
**Since:** PMD 6.13.0
**Priority:** Medium (3)
The second parameter of System.assert/third parameter of System.assertEquals/System.assertNotEquals is a message.
Having a second/third parameter provides more information and makes it easier to debug the test failure and
improves the readability of test output.
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.apex.rule.bestpractices.ApexAssertionsShouldIncludeMessageRule](https://github.com/pmd/pmd/blob/master/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexAssertionsShouldIncludeMessageRule.java)
**Example(s):**
``` java
@isTest
public class Foo {
@isTest
static void methodATest() {
System.assertNotEquals('123', o.StageName); // not good
System.assertEquals('123', o.StageName, 'Opportunity stageName is wrong.'); // good
System.assert(o.isClosed); // not good
System.assert(o.isClosed, 'Opportunity is not closed.'); // good
}
}
```
**This rule has the following properties:**
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Bug Risk|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/bestpractices.xml/ApexAssertionsShouldIncludeMessage" />
```
## ApexUnitTestClassShouldHaveAsserts
**Since:** PMD 5.5.1
@ -38,15 +78,60 @@ public class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Bug Risk|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/bestpractices.xml/ApexUnitTestClassShouldHaveAsserts" />
```
## ApexUnitTestMethodShouldHaveIsTestAnnotation
**Since:** PMD 6.13.0
**Priority:** Medium (3)
Apex test methods should have @isTest annotation.
As testMethod keyword is deprecated, Salesforce advices to use @isTest annotation for test class/methods.
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.apex.rule.bestpractices.ApexUnitTestMethodShouldHaveIsTestAnnotationRule](https://github.com/pmd/pmd/blob/master/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/ApexUnitTestMethodShouldHaveIsTestAnnotationRule.java)
**Example(s):**
``` java
@isTest
private class ATest {
@isTest
static void methodATest() {
}
static void methodBTest() {
}
@isTest static void methodCTest() {
System.assert(1==2);
}
@isTest static void methodCTest() {
System.debug('I am a debug statement');
}
private void fetchData() {
}
}
```
**This rule has the following properties:**
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Bug Risk|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/bestpractices.xml/ApexUnitTestMethodShouldHaveIsTestAnnotation" />
```
## ApexUnitTestShouldNotUseSeeAllDataTrue
**Since:** PMD 5.5.1
@ -75,11 +160,11 @@ public class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Bug Risk|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/bestpractices.xml/ApexUnitTestShouldNotUseSeeAllDataTrue" />
```
@ -110,10 +195,10 @@ global class Unchangeable {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/bestpractices.xml/AvoidGlobalModifier" />
```
@ -154,10 +239,10 @@ trigger Accounts on Account (before insert, before update, before delete, after
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_remediation\_points\_multiplier|200|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/bestpractices.xml/AvoidLogicInTrigger" />
```

View File

@ -30,10 +30,10 @@ public class Foo {}
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_remediation\_points\_multiplier|5|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/codestyle.xml/ClassNamingConventions" />
```
@ -74,7 +74,7 @@ for (int i = 0; i < 42; i++) { // preferred approach
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/codestyle.xml/ForLoopsMustUseBraces" />
```
@ -117,7 +117,7 @@ else
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/codestyle.xml/IfElseStmtsMustUseBraces" />
```
@ -156,7 +156,7 @@ if (foo) { // preferred approach
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/codestyle.xml/IfStmtsMustUseBraces" />
```
@ -189,11 +189,20 @@ public class Foo {
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
|skipTestMethodUnderscores|false|Skip underscores in test methods|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/codestyle.xml/MethodNamingConventions" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/apex/codestyle.xml/MethodNamingConventions">
<properties>
<property name="skipTestMethodUnderscores" value="false" />
</properties>
</rule>
```
## OneDeclarationPerLine
**Since:** PMD 6.7.0
@ -235,11 +244,20 @@ Integer b;
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
|strictMode|false|If true, mark combined declaration even if the declarations are on separate lines.|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/codestyle.xml/OneDeclarationPerLine" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/apex/codestyle.xml/OneDeclarationPerLine">
<properties>
<property name="strictMode" value="false" />
</properties>
</rule>
```
## VariableNamingConventions
**Since:** PMD 5.5.0
@ -267,7 +285,7 @@ public class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_remediation\_points\_multiplier|5|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
|checkMembers|true|Check member variables|no|
|checkLocals|true|Check local variables|no|
@ -281,11 +299,30 @@ public class Foo {
|parameterPrefix||Method parameter variable prefixes|yes. Delimiter is ','.|
|parameterSuffix||Method parameter variable suffixes|yes. Delimiter is ','.|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/codestyle.xml/VariableNamingConventions" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/apex/codestyle.xml/VariableNamingConventions">
<properties>
<property name="checkMembers" value="true" />
<property name="checkLocals" value="true" />
<property name="checkParameters" value="true" />
<property name="staticPrefix" value="" />
<property name="staticSuffix" value="" />
<property name="memberPrefix" value="" />
<property name="memberSuffix" value="" />
<property name="localPrefix" value="" />
<property name="localSuffix" value="" />
<property name="parameterPrefix" value="" />
<property name="parameterSuffix" value="" />
</properties>
</rule>
```
## WhileLoopsMustUseBraces
**Since:** PMD 5.6.0
@ -320,7 +357,7 @@ while (true) { // preferred approach
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/codestyle.xml/WhileLoopsMustUseBraces" />
```

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ public class HelloWorld {
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/documentation.xml/ApexDoc" />
```

View File

@ -42,7 +42,7 @@ trigger AccountTrigger on Account (before insert, before update) {
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/AvoidDirectAccessTriggerMap" />
```
@ -79,10 +79,10 @@ public without sharing class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/AvoidHardcodingId" />
```
@ -118,7 +118,7 @@ A full list of supported annotations can be found at https://developer.salesforc
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/AvoidNonExistentAnnotations" />
```
@ -159,7 +159,7 @@ public void doSomething() {
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/EmptyCatchBlock" />
```
@ -198,7 +198,7 @@ public class Foo {
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/EmptyIfStmt" />
```
@ -239,7 +239,7 @@ public class Foo {
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/EmptyStatementBlock" />
```
@ -289,7 +289,7 @@ public class Foo {
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/EmptyTryOrFinallyBlock" />
```
@ -327,7 +327,7 @@ public void bar(Integer a, Integer b) {
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/EmptyWhileStmt" />
```
@ -358,10 +358,10 @@ public class MyClass {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_remediation\_points\_multiplier|50|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/errorprone.xml/MethodWithSameNameAsEnclosingClass" />
```

View File

@ -37,11 +37,11 @@ public class Something {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Performance|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|150|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/performance.xml/AvoidDmlStatementsInLoops" />
```
@ -72,11 +72,11 @@ public class Something {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Performance|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|150|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/performance.xml/AvoidSoqlInLoops" />
```
@ -107,11 +107,11 @@ public class Something {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Performance|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|150|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/performance.xml/AvoidSoslInLoops" />
```

View File

@ -35,11 +35,11 @@ public without sharing class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexBadCrypto" />
```
@ -79,11 +79,11 @@ public class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexCRUDViolation" />
```
@ -117,11 +117,11 @@ public class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexCSRF" />
```
@ -157,11 +157,11 @@ public class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexDangerousMethods" />
```
@ -192,11 +192,11 @@ public without sharing class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexInsecureEndpoint" />
```
@ -227,11 +227,11 @@ public without sharing class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexOpenRedirect" />
```
@ -259,11 +259,11 @@ public without sharing class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexSharingViolations" />
```
@ -292,11 +292,11 @@ public class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexSOQLInjection" />
```
@ -339,11 +339,11 @@ public class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexSuggestUsingNamedCred" />
```
@ -372,11 +372,11 @@ public without sharing class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|100|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexXSSFromEscapeFalse" />
```
@ -405,11 +405,11 @@ public without sharing class Foo {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|cc\_categories|Style|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|1|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_categories|Security|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Categories|yes. Delimiter is '\|'.|
|cc\_remediation\_points\_multiplier|50|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Remediation Points multiplier|no|
|cc\_block\_highlighting|false|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> Code Climate Block Highlighting|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/apex/security.xml/ApexXSSFromURLParam" />
```

View File

@ -71,15 +71,26 @@ function bar() {
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|rhinoLanguageVersion|VERSION\_DEFAULT|Specifies the Rhino Language Version to use for parsing. Defaults to Rhino default.|no|
|rhinoLanguageVersion|default|Specifies the Rhino Language Version to use for parsing. Defaults to Rhino default.|no|
|recordingLocalJsDocComments|true|Specifies that JsDoc comments are produced in the AST.|no|
|recordingComments|true|Specifies that comments are produced in the AST.|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/ecmascript/bestpractices.xml/ConsistentReturn" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/ecmascript/bestpractices.xml/ConsistentReturn">
<properties>
<property name="rhinoLanguageVersion" value="default" />
<property name="recordingLocalJsDocComments" value="true" />
<property name="recordingComments" value="true" />
</properties>
</rule>
```
## GlobalVariable
**Since:** PMD 5.0

View File

@ -58,11 +58,25 @@ function getX() {
|allowTernaryResults|false|Allow assignment within the result expressions of a ternary operator|no|
|allowIncrementDecrement|false|Allow increment or decrement operators within the conditional expression of an if, for, or while statement|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/ecmascript/codestyle.xml/AssignmentInOperand" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/ecmascript/codestyle.xml/AssignmentInOperand">
<properties>
<property name="allowIf" value="false" />
<property name="allowFor" value="false" />
<property name="allowWhile" value="false" />
<property name="allowTernary" value="false" />
<property name="allowTernaryResults" value="false" />
<property name="allowIncrementDecrement" value="false" />
</properties>
</rule>
```
## ForLoopsMustUseBraces
**Since:** PMD 5.0

View File

@ -43,11 +43,21 @@ function(arg) {
|allowObjectLiteral|false|Allow a trailing comma within an object literal|no|
|allowArrayLiteral|false|Allow a trailing comma within an array literal|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/ecmascript/errorprone.xml/AvoidTrailingComma" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/ecmascript/errorprone.xml/AvoidTrailingComma">
<properties>
<property name="allowObjectLiteral" value="false" />
<property name="allowArrayLiteral" value="false" />
</properties>
</rule>
```
## EqualComparison
**Since:** PMD 5.0

File diff suppressed because one or more lines are too long

View File

@ -230,11 +230,21 @@ public class Foo {
|foreachReassign|deny|how/if foreach control variables may be reassigned|no|
|forReassign|deny|how/if for control variables may be reassigned|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/AvoidReassigningLoopVariables" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/AvoidReassigningLoopVariables">
<properties>
<property name="foreachReassign" value="deny" />
<property name="forReassign" value="deny" />
</properties>
</rule>
```
## AvoidReassigningParameters
**Since:** PMD 1.0
@ -312,11 +322,20 @@ public class Foo {
|----|-------------|-----------|-----------|
|checkAddressTypes|IPv4 mapped IPv6 \| IPv6 \| IPv4|Check for IP address types.|yes. Delimiter is '\|'.|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP">
<properties>
<property name="checkAddressTypes" value="IPv4 mapped IPv6|IPv6|IPv4" />
</properties>
</rule>
```
## CheckResultSet
**Since:** PMD 4.1
@ -395,11 +414,20 @@ public interface YetAnotherConstantInterface {
|----|-------------|-----------|-----------|
|ignoreIfHasMethods|true|Whether to ignore constants in interfaces if the interface defines any methods|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/ConstantsInInterface" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/ConstantsInInterface">
<properties>
<property name="ignoreIfHasMethods" value="true" />
</properties>
</rule>
```
## DefaultLabelNotLastInSwitchStmt
**Since:** PMD 1.5
@ -501,11 +529,20 @@ for (int i = 0, j = 0; i < 10; i++, j += 2) {
|----|-------------|-----------|-----------|
|maximumVariables|1|A regular for statement will have 1 control variable|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/ForLoopVariableCount" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/ForLoopVariableCount">
<properties>
<property name="maximumVariables" value="1" />
</properties>
</rule>
```
## GuardLogStatement
**Since:** PMD 5.1.0
@ -532,11 +569,21 @@ otherwise skip the associate String creation and manipulation.
|logLevels|trace , debug , info , warn , error , log , finest , finer , fine , info , warning , severe|LogLevels to guard|yes. Delimiter is ','.|
|guardsMethods|isTraceEnabled , isDebugEnabled , isInfoEnabled , isWarnEnabled , isErrorEnabled , isLoggable|Method use to guard the log statement|yes. Delimiter is ','.|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/GuardLogStatement" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/GuardLogStatement">
<properties>
<property name="logLevels" value="trace,debug,info,warn,error,log,finest,finer,fine,info,warning,severe" />
<property name="guardsMethods" value="isTraceEnabled,isDebugEnabled,isInfoEnabled,isWarnEnabled,isErrorEnabled,isLoggable" />
</properties>
</rule>
```
## JUnit4SuitesShouldUseSuiteAnnotation
**Since:** PMD 4.0
@ -702,11 +749,20 @@ public class MyTest {
|----|-------------|-----------|-----------|
|testClassPattern|Test|The regex pattern used to identify test classes|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/JUnit4TestShouldUseTestAnnotation" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/JUnit4TestShouldUseTestAnnotation">
<properties>
<property name="testClassPattern" value="Test" />
</properties>
</rule>
```
## JUnitAssertionsShouldIncludeMessage
**Since:** PMD 1.04
@ -787,11 +843,20 @@ public class MyTestCase extends TestCase {
|----|-------------|-----------|-----------|
|maximumAsserts|1|Maximum number of Asserts in a test method|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/JUnitTestContainsTooManyAsserts" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/JUnitTestContainsTooManyAsserts">
<properties>
<property name="maximumAsserts" value="1" />
</properties>
</rule>
```
## JUnitTestsShouldIncludeAssert
**Since:** PMD 2.0
@ -993,11 +1058,20 @@ String name,
|----|-------------|-----------|-----------|
|strictMode|false|If true, mark combined declaration even if the declarations are on separate lines.|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine">
<properties>
<property name="strictMode" value="false" />
</properties>
</rule>
```
## PositionLiteralsFirstInCaseInsensitiveComparisons
**Since:** PMD 5.1
@ -1303,11 +1377,20 @@ public class Foo {
|----|-------------|-----------|-----------|
|checkAll|false|Check all methods, including non-private ones|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter">
<properties>
<property name="checkAll" value="false" />
</properties>
</rule>
```
## UnusedImports
**Since:** PMD 1.0
@ -1387,11 +1470,20 @@ public class Something {
|----|-------------|-----------|-----------|
|ignoredAnnotations|lombok.Setter \| lombok.Getter \| lombok.Builder \| lombok.Data \| lombok.RequiredArgsConstructor \| lombok.AllArgsConstructor \| lombok.Value \| lombok.NoArgsConstructor \| java.lang.Deprecated \| javafx.fxml.FXML|Fully qualified names of the annotation types that should be ignored by this rule|yes. Delimiter is '\|'.|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/UnusedPrivateField">
<properties>
<property name="ignoredAnnotations" value="lombok.Setter|lombok.Getter|lombok.Builder|lombok.Data|lombok.RequiredArgsConstructor|lombok.AllArgsConstructor|lombok.Value|lombok.NoArgsConstructor|java.lang.Deprecated|javafx.fxml.FXML" />
</properties>
</rule>
```
## UnusedPrivateMethod
**Since:** PMD 0.7
@ -1416,11 +1508,20 @@ public class Something {
|----|-------------|-----------|-----------|
|ignoredAnnotations|java.lang.Deprecated|Fully qualified names of the annotation types that should be ignored by this rule|yes. Delimiter is '\|'.|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod">
<properties>
<property name="ignoredAnnotations" value="java.lang.Deprecated" />
</properties>
</rule>
```
## UseAssertEqualsInsteadOfAssertTrue
**Since:** PMD 3.1
@ -1657,7 +1758,7 @@ preserved.
][
pmd-java:typeIs('java.lang.AutoCloseable')
or
../../PrimarySuffix/Arguments[@ArgumentCount = 1]//PrimaryPrefix[pmd-java:typeIs('java.lang.AutoCloseable')]
../../PrimarySuffix/Arguments//PrimaryPrefix[pmd-java:typeIs('java.lang.AutoCloseable')]
]]
```
@ -1694,11 +1795,20 @@ public class TryWithResources {
|----|-------------|-----------|-----------|
|closeMethods|close , closeQuietly|Method names in finally block, which trigger this rule|yes. Delimiter is ','.|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/bestpractices.xml/UseTryWithResources" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/bestpractices.xml/UseTryWithResources">
<properties>
<property name="closeMethods" value="close,closeQuietly" />
</properties>
</rule>
```
## UseVarargs
**Since:** PMD 5.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -32,11 +32,21 @@ A rule for the politically correct... we don't want to offend anyone.
|caseSensitive|false|Case sensitive|no|
|disallowedTerms|idiot \| jerk|Illegal terms or phrases|yes. Delimiter is '\|'.|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/documentation.xml/CommentContent" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/documentation.xml/CommentContent">
<properties>
<property name="caseSensitive" value="false" />
<property name="disallowedTerms" value="idiot|jerk" />
</properties>
</rule>
```
## CommentRequired
**Since:** PMD 5.1
@ -70,11 +80,27 @@ Denotes whether comments are required (or unwanted) for specific language elemen
|enumCommentRequirement|Required|Enum comments. Possible values: \[Required, Ignored, Unwanted\]|no|
|serialVersionUIDCommentRequired|Ignored|Serial version UID comments. Possible values: \[Required, Ignored, Unwanted\]|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/documentation.xml/CommentRequired" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/documentation.xml/CommentRequired">
<properties>
<property name="methodWithOverrideCommentRequirement" value="Ignored" />
<property name="accessorCommentRequirement" value="Ignored" />
<property name="headerCommentRequirement" value="Required" />
<property name="fieldCommentRequirement" value="Required" />
<property name="publicMethodCommentRequirement" value="Required" />
<property name="protectedMethodCommentRequirement" value="Required" />
<property name="enumCommentRequirement" value="Required" />
<property name="serialVersionUIDCommentRequired" value="Ignored" />
</properties>
</rule>
```
## CommentSize
**Since:** PMD 5.0
@ -113,11 +139,21 @@ Determines whether the dimensions of non-header comments found are within the sp
|maxLines|6|Maximum lines|no|
|maxLineLength|80|Maximum line length|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/documentation.xml/CommentSize" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/documentation.xml/CommentSize">
<properties>
<property name="maxLines" value="6" />
<property name="maxLineLength" value="80" />
</properties>
</rule>
```
## UncommentedEmptyConstructor
**Since:** PMD 3.4
@ -150,11 +186,20 @@ public Foo() {
|----|-------------|-----------|-----------|
|ignoreExplicitConstructorInvocation|false|Ignore explicit constructor invocation when deciding whether constructor is empty or not|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/documentation.xml/UncommentedEmptyConstructor" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/documentation.xml/UncommentedEmptyConstructor">
<properties>
<property name="ignoreExplicitConstructorInvocation" value="false" />
</properties>
</rule>
```
## UncommentedEmptyMethodBody
**Since:** PMD 3.4

View File

@ -39,11 +39,23 @@ public void bar() {
|allowWhile|false|Allow assignment within the conditional expression of a while statement|no|
|allowIncrementDecrement|false|Allow increment or decrement operators within the conditional expression of an if, for, or while statement|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/AssignmentInOperand" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/AssignmentInOperand">
<properties>
<property name="allowIf" value="false" />
<property name="allowFor" value="false" />
<property name="allowWhile" value="false" />
<property name="allowIncrementDecrement" value="false" />
</properties>
</rule>
```
## AssignmentToNonFinalStatic
**Since:** PMD 2.2
@ -209,11 +221,22 @@ for (int i = 0; i < 10; i++) {
|checkContinueLoopTypes|for \| do \| while|List of loop types in which continue statements will be checked|yes. Delimiter is '\|'.|
|checkReturnLoopTypes|for \| do \| while|List of loop types in which return statements will be checked|yes. Delimiter is '\|'.|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop">
<properties>
<property name="checkBreakLoopTypes" value="for|do|while" />
<property name="checkContinueLoopTypes" value="for|do|while" />
<property name="checkReturnLoopTypes" value="for|do|while" />
</properties>
</rule>
```
## AvoidCallingFinalize
**Since:** PMD 3.0
@ -389,11 +412,24 @@ private void buz(String x) {}
|skipAnnotations|false|Skip literals within annotations|no|
|exceptionList||List of literals to ignore. A literal is ignored if its image can be found in this list. Components of this list should not be surrounded by double quotes.|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals">
<properties>
<property name="separator" value="," />
<property name="maxDuplicateLiterals" value="4" />
<property name="minimumLength" value="3" />
<property name="skipAnnotations" value="false" />
<property name="exceptionList" value="" />
</properties>
</rule>
```
## AvoidEnumAsIdentifier
**Since:** PMD 3.4
@ -562,11 +598,20 @@ public void checkRequests() {
|----|-------------|-----------|-----------|
|ignoreMagicNumbers|-1,0|Comma-separated list of magic numbers, that should be ignored|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
<properties>
<property name="ignoreMagicNumbers" value="-1,0" />
</properties>
</rule>
```
## AvoidLosingExceptionInformation
**Since:** PMD 4.2.6
@ -672,11 +717,20 @@ k = i * j; // set k with 80 not 120
|----|-------------|-----------|-----------|
|strict|false|Detect violations between 00 and 07|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues">
<properties>
<property name="strict" value="false" />
</properties>
</rule>
```
## BadComparison
**Since:** PMD 1.8
@ -741,11 +795,21 @@ private int getMoreFoo(){
|ignoredAnnotations|lombok.Data \| lombok.Getter \| lombok.Value|Fully qualified names of the annotation types that should be ignored by this rule|yes. Delimiter is '\|'.|
|prefix||A variable prefix to skip, i.e., m\_|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/BeanMembersShouldSerialize" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/BeanMembersShouldSerialize">
<properties>
<property name="ignoredAnnotations" value="lombok.Data|lombok.Getter|lombok.Value" />
<property name="prefix" value="" />
</properties>
</rule>
```
## BrokenNullCheck
**Since:** PMD 3.8
@ -1129,11 +1193,22 @@ public class Bar {
|types|java.sql.Connection , java.sql.Statement , java.sql.ResultSet|Affected types|yes. Delimiter is ','.|
|closeAsDefaultTarget|true|Consider 'close' as a target by default|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/CloseResource" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/CloseResource">
<properties>
<property name="closeTargets" value="" />
<property name="types" value="java.sql.Connection,java.sql.Statement,java.sql.ResultSet" />
<property name="closeAsDefaultTarget" value="true" />
</properties>
</rule>
```
## CompareObjectsWithEquals
**Since:** PMD 3.2
@ -1236,11 +1311,21 @@ public void foo() {
|maxPaths|1000|Maximum number of checked paths per method. A lower value will increase the performance of the rule but may decrease anomalies found.|no|
|maxViolations|100|Maximum number of anomalies per class|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/DataflowAnomalyAnalysis" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/DataflowAnomalyAnalysis">
<properties>
<property name="maxPaths" value="1000" />
<property name="maxViolations" value="100" />
</properties>
</rule>
```
## DetachedTestCase
**Since:** PMD 6.13.0
@ -1571,11 +1656,21 @@ public void doSomething() {
|allowCommentedBlocks|false|Empty blocks containing comments will be skipped|no|
|allowExceptionNameRegex|^(ignored\|expected)$|Empty blocks catching exceptions with names matching this regular expression will be skipped|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/EmptyCatchBlock">
<properties>
<property name="allowCommentedBlocks" value="false" />
<property name="allowExceptionNameRegex" value="^(ignored|expected)$" />
</properties>
</rule>
```
## EmptyFinalizer
**Since:** PMD 1.5
@ -2784,11 +2879,20 @@ public class Foo {
|----|-------------|-----------|-----------|
|staticLoggerName|LOG|Name of the static Logger variable|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/errorprone.xml/ProperLogger" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/errorprone.xml/ProperLogger">
<properties>
<property name="staticLoggerName" value="LOG" />
</properties>
</rule>
```
## ReturnEmptyArrayRatherThanNull
**Since:** PMD 4.2

View File

@ -268,11 +268,21 @@ public static Foo getFoo() {
|checkNonStaticMethods|true|Check for non-static methods. Do not set this to false and checkNonStaticFields to true.|no|
|checkNonStaticFields|false|Check for non-static fields. Do not set this to true and checkNonStaticMethods to false.|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/multithreading.xml/NonThreadSafeSingleton" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/multithreading.xml/NonThreadSafeSingleton">
<properties>
<property name="checkNonStaticMethods" value="true" />
<property name="checkNonStaticFields" value="false" />
</properties>
</rule>
```
## UnsynchronizedStaticDateFormatter
<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f;">Deprecated</span>

View File

@ -387,11 +387,20 @@ buf.append("1m"); // good
|----|-------------|-----------|-----------|
|threshold|1|Max consecutive appends|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/performance.xml/ConsecutiveLiteralAppends" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/performance.xml/ConsecutiveLiteralAppends">
<properties>
<property name="threshold" value="1" />
</properties>
</rule>
```
## InefficientEmptyStringCheck
**Since:** PMD 3.6
@ -800,11 +809,20 @@ public class Foo {
|----|-------------|-----------|-----------|
|minimumNumberCaseForASwitch|3|Minimum number of branches for a switch|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/java/performance.xml/TooFewBranchesForASwitchStatement" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/java/performance.xml/TooFewBranchesForASwitchStatement">
<properties>
<property name="minimumNumberCaseForASwitch" value="3" />
</properties>
</rule>
```
## UnnecessaryWrapperObjectCreation
**Since:** PMD 3.8

View File

@ -17,8 +17,10 @@ folder: pmd/rules
{% include callout.html content="Rules which enforce a specific coding style." %}
* [AvoidTabCharacter](pmd_rules_plsql_codestyle.html#avoidtabcharacter): This rule checks, that there are no tab characters ('\t') in the source file.It reports only the ...
* [CodeFormat](pmd_rules_plsql_codestyle.html#codeformat): This rule verifies that the PLSQL code is properly formatted. The following checks are executed:S...
* [ForLoopNaming](pmd_rules_plsql_codestyle.html#forloopnaming): In case you have loops please name the loop variables more meaningful.
* [LineLength](pmd_rules_plsql_codestyle.html#linelength): This rule checks for long lines. Please note that comments are not ignored.This rule is the PMD e...
* [MisplacedPragma](pmd_rules_plsql_codestyle.html#misplacedpragma): Oracle states that the PRAQMA AUTONOMOUS_TRANSACTION must be in the declaration block,but the cod...
## Design

View File

@ -5,10 +5,46 @@ permalink: pmd_rules_plsql_codestyle.html
folder: pmd/rules/plsql
sidebaractiveurl: /pmd_rules_plsql.html
editmepath: ../pmd-plsql/src/main/resources/category/plsql/codestyle.xml
keywords: Code Style, CodeFormat, MisplacedPragma, ForLoopNaming
keywords: Code Style, AvoidTabCharacter, CodeFormat, MisplacedPragma, ForLoopNaming, LineLength
language: PLSQL
---
<!-- DO NOT EDIT THIS FILE. This file is generated from file ../pmd-plsql/src/main/resources/category/plsql/codestyle.xml. -->
## AvoidTabCharacter
**Since:** PMD 6.13.0
**Priority:** Medium (3)
This rule checks, that there are no tab characters (`\t`) in the source file.
It reports only the first occurrence per file.
Using tab characters for indentation is not recommended, since this requires that every developer
uses the same tab with in their editor.
This rule is the PMD equivalent of checkstyle's [FileTabCharacter](http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter) check.
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codestyle.AvoidTabCharacterRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/AvoidTabCharacterRule.java)
**This rule has the following properties:**
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|eachLine|false|Whether to report each line with a tab character or only the first line|no|
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/plsql/codestyle.xml/AvoidTabCharacter" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/plsql/codestyle.xml/AvoidTabCharacter">
<properties>
<property name="eachLine" value="false" />
</properties>
</rule>
```
## CodeFormat
**Since:** PMD 6.9.0
@ -81,11 +117,20 @@ END;
|----|-------------|-----------|-----------|
|indentation|2|Indentation to be used for blocks|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/plsql/codestyle.xml/CodeFormat" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/plsql/codestyle.xml/CodeFormat">
<properties>
<property name="indentation" value="2" />
</properties>
</rule>
```
## ForLoopNaming
**Since:** PMD 6.7.0
@ -145,11 +190,56 @@ END;
|cursorPattern|\[a-zA-Z\_0-9\]{5,}|The pattern used for the curosr loop variable|no|
|indexPattern|\[a-zA-Z\_0-9\]{5,}|The pattern used for the index loop variable|no|
**Use this rule by referencing it:**
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/plsql/codestyle.xml/ForLoopNaming" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/plsql/codestyle.xml/ForLoopNaming">
<properties>
<property name="allowSimpleLoops" value="false" />
<property name="cursorPattern" value="[a-zA-Z_0-9]{5,}" />
<property name="indexPattern" value="[a-zA-Z_0-9]{5,}" />
</properties>
</rule>
```
## LineLength
**Since:** PMD 6.13.0
**Priority:** Medium (3)
This rule checks for long lines. Please note that comments are not ignored.
This rule is the PMD equivalent of checkstyle's [LineLength](http://checkstyle.sourceforge.net/config_sizes.html#LineLength) check.
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codestyle.LineLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/LineLengthRule.java)
**This rule has the following properties:**
|Name|Default Value|Description|Multivalued|
|----|-------------|-----------|-----------|
|maxLineLength|80|The maximum allowed line length|no|
|eachLine|false|Whether to report each line that is longer only the first line|no|
**Use this rule with the default properties by just referencing it:**
``` xml
<rule ref="category/plsql/codestyle.xml/LineLength" />
```
**Use this rule and customize it:**
``` xml
<rule ref="category/plsql/codestyle.xml/LineLength">
<properties>
<property name="maxLineLength" value="80" />
<property name="eachLine" value="false" />
</properties>
</rule>
```
## MisplacedPragma
**Since:** PMD 5.5.2

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More