diff --git a/feed.xml b/feed.xml index 1f4ec75599..1fe02af3a5 100644 --- a/feed.xml +++ b/feed.xml @@ -5,8 +5,8 @@ Intended as a documentation theme based on Jekyll for technical writers documenting software and other technical products, this theme has all the elements you would need to handle multiple products with both multi-level sidebar navigation, tags, and other documentation features. https://pmd.github.io/pmd/ - Fri, 17 May 2019 14:34:18 +0000 - Fri, 17 May 2019 14:34:18 +0000 + Fri, 17 May 2019 14:53:38 +0000 + Fri, 17 May 2019 14:53:38 +0000 Jekyll v3.7.4 diff --git a/pmd_rules_apex.html b/pmd_rules_apex.html index 57a612182b..0ab05873a3 100644 --- a/pmd_rules_apex.html +++ b/pmd_rules_apex.html @@ -1299,13 +1299,17 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
Rules which enforce a specific coding style.
diff --git a/pmd_rules_apex_codestyle.html b/pmd_rules_apex_codestyle.html index d230f861b5..7abf42304c 100644 --- a/pmd_rules_apex_codestyle.html +++ b/pmd_rules_apex_codestyle.html @@ -5,7 +5,7 @@ - + Code Style | PMD Source Code Analyzer @@ -1287,13 +1287,20 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3

Priority: High (1)

-

Class names should always begin with an upper case character.

+

Configurable naming conventions for type declarations. This rule reports +type declarations which do not match the regex that applies to their +specific kind (e.g. enum or interface). Each regex can be configured through +properties.

+ +

By default this rule uses the standard Apex naming convention (Pascal case).

This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.ClassNamingConventionsRule

Example(s):

-
public class Foo {}
+
public class FooClass { } // This is in pascal case, so it's ok
+
+public class fooClass { } // This will be reported unless you change the regex
 

This rule has the following properties:

@@ -1326,6 +1333,36 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3 Deprecated Code Climate Block Highlighting no + + testClassPattern + [A-Z][a-zA-Z0-9_]* + Regex which applies to test class names + no + + + abstractClassPattern + [A-Z][a-zA-Z0-9_]* + Regex which applies to abstract class names + no + + + classPattern + [A-Z][a-zA-Z0-9_]* + Regex which applies to class names + no + + + interfacePattern + [A-Z][a-zA-Z0-9_]* + Regex which applies to interface names + no + + + enumPattern + [A-Z][a-zA-Z0-9_]* + Regex which applies to enum names + no + @@ -1333,6 +1370,120 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
<rule ref="category/apex/codestyle.xml/ClassNamingConventions" />
 
+

Use this rule and customize it:

+
<rule ref="category/apex/codestyle.xml/ClassNamingConventions">
+    <properties>
+        <property name="testClassPattern" value="[A-Z][a-zA-Z0-9_]*" />
+        <property name="abstractClassPattern" value="[A-Z][a-zA-Z0-9_]*" />
+        <property name="classPattern" value="[A-Z][a-zA-Z0-9_]*" />
+        <property name="interfacePattern" value="[A-Z][a-zA-Z0-9_]*" />
+        <property name="enumPattern" value="[A-Z][a-zA-Z0-9_]*" />
+    </properties>
+</rule>
+
+ +

FieldNamingConventions

+ +

Since: PMD 6.15.0

+ +

Priority: High (1)

+ +

Configurable naming conventions for field declarations. This rule reports variable declarations +which do not match the regex that applies to their specific kind —e.g. constants (static final), +static field, final field. Each regex can be configured through properties.

+ +

By default this rule uses the standard Apex naming convention (Camel case).

+ +

This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.FieldNamingConventionsRule

+ +

Example(s):

+ +
public class Foo {
+    Integer instanceField; // This is in camel case, so it's ok
+
+    Integer INSTANCE_FIELD; // This will be reported unless you change the regex
+}
+
+ +

This rule has the following properties:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefault ValueDescriptionMultivalued
cc_categoriesStyleDeprecated Code Climate Categoriesyes. Delimiter is ‘|’.
cc_remediation_points_multiplier1Deprecated Code Climate Remediation Points multiplierno
cc_block_highlightingfalseDeprecated Code Climate Block Highlightingno
enumConstantPattern[A-Z][A-Z0-9_]*Regex which applies to enum constant field namesno
constantPattern[A-Z][A-Z0-9_]*Regex which applies to constant field namesno
finalPattern[a-z][a-zA-Z0-9]*Regex which applies to final field namesno
staticPattern[a-z][a-zA-Z0-9]*Regex which applies to static field namesno
instancePattern[a-z][a-zA-Z0-9]*Regex which applies to instance field namesno
+ +

Use this rule with the default properties by just referencing it:

+
<rule ref="category/apex/codestyle.xml/FieldNamingConventions" />
+
+ +

Use this rule and customize it:

+
<rule ref="category/apex/codestyle.xml/FieldNamingConventions">
+    <properties>
+        <property name="enumConstantPattern" value="[A-Z][A-Z0-9_]*" />
+        <property name="constantPattern" value="[A-Z][A-Z0-9_]*" />
+        <property name="finalPattern" value="[a-z][a-zA-Z0-9]*" />
+        <property name="staticPattern" value="[a-z][a-zA-Z0-9]*" />
+        <property name="instancePattern" value="[a-z][a-zA-Z0-9]*" />
+    </properties>
+</rule>
+
+

ForLoopsMustUseBraces

Since: PMD 5.6.0

@@ -1396,6 +1547,88 @@ from the rest.

<rule ref="category/apex/codestyle.xml/ForLoopsMustUseBraces" />
 
+

FormalParameterNamingConventions

+ +

Since: PMD 6.15.0

+ +

Priority: High (1)

+ +

Configurable naming conventions for formal parameters of methods. +This rule reports formal parameters which do not match the regex that applies to their +specific kind (e.g. method parameter, or final method parameter). Each regex can be +configured through properties.

+ +

By default this rule uses the standard Apex naming convention (Camel case).

+ +

This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.FormalParameterNamingConventionsRule

+ +

Example(s):

+ +
public class Foo {
+    public bar(Integer methodParameter) { } // This is in camel case, so it's ok
+
+    public baz(Integer METHOD_PARAMETER) { } // This will be reported unless you change the regex
+}
+
+ +

This rule has the following properties:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefault ValueDescriptionMultivalued
cc_categoriesStyleDeprecated Code Climate Categoriesyes. Delimiter is ‘|’.
cc_remediation_points_multiplier1Deprecated Code Climate Remediation Points multiplierno
cc_block_highlightingfalseDeprecated Code Climate Block Highlightingno
finalMethodParameterPattern[a-z][a-zA-Z0-9]*Regex which applies to final method parameter namesno
methodParameterPattern[a-z][a-zA-Z0-9]*Regex which applies to method parameter namesno
+ +

Use this rule with the default properties by just referencing it:

+
<rule ref="category/apex/codestyle.xml/FormalParameterNamingConventions" />
+
+ +

Use this rule and customize it:

+
<rule ref="category/apex/codestyle.xml/FormalParameterNamingConventions">
+    <properties>
+        <property name="finalMethodParameterPattern" value="[a-z][a-zA-Z0-9]*" />
+        <property name="methodParameterPattern" value="[a-z][a-zA-Z0-9]*" />
+    </properties>
+</rule>
+
+

IfElseStmtsMustUseBraces

Since: PMD 5.6.0

@@ -1522,26 +1755,115 @@ controlled from the rest.

<rule ref="category/apex/codestyle.xml/IfStmtsMustUseBraces" />
 
-

MethodNamingConventions

+

LocalVariableNamingConventions

-

Since: PMD 5.5.0

+

Since: PMD 6.15.0

Priority: High (1)

-

Method names should always begin with a lower case character, and should not contain underscores.

+

Configurable naming conventions for local variable declarations. +This rule reports variable declarations which do not match the regex that applies to their +specific kind (e.g. local variable, or final local variable). Each regex can be configured through +properties.

-

This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.MethodNamingConventionsRule

+

By default this rule uses the standard Apex naming convention (Camel case).

+ +

This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.LocalVariableNamingConventionsRule

Example(s):

public class Foo {
-    public void fooStuff() {
+    public Foo() {
+        Integer localVariable; // This is in camel case, so it's ok
+
+        Integer LOCAL_VARIABLE; // This will be reported unless you change the regex
     }
 }
 

This rule has the following properties:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefault ValueDescriptionMultivalued
cc_categoriesStyleDeprecated Code Climate Categoriesyes. Delimiter is ‘|’.
cc_remediation_points_multiplier1Deprecated Code Climate Remediation Points multiplierno
cc_block_highlightingfalseDeprecated Code Climate Block Highlightingno
finalLocalPattern[a-z][a-zA-Z0-9]*Regex which applies to final local variable namesno
localPattern[a-z][a-zA-Z0-9]*Regex which applies to local variable namesno
+ +

Use this rule with the default properties by just referencing it:

+
<rule ref="category/apex/codestyle.xml/LocalVariableNamingConventions" />
+
+ +

Use this rule and customize it:

+
<rule ref="category/apex/codestyle.xml/LocalVariableNamingConventions">
+    <properties>
+        <property name="finalLocalPattern" value="[a-z][a-zA-Z0-9]*" />
+        <property name="localPattern" value="[a-z][a-zA-Z0-9]*" />
+    </properties>
+</rule>
+
+ +

MethodNamingConventions

+ +

Since: PMD 5.5.0

+ +

Priority: High (1)

+ +

Configurable naming conventions for method declarations. This rule reports +method declarations which do not match the regex that applies to their +specific kind (e.g. static method, or test method). Each regex can be +configured through properties.

+ +

By default this rule uses the standard Apex naming convention (Camel case).

+ +

This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.MethodNamingConventionsRule

+ +

Example(s):

+ +
public class Foo {
+    public void instanceMethod() { } // This is in camel case, so it's ok
+
+    public void INSTANCE_METHOD() { } // This will be reported unless you change the regex
+
+ +

This rule has the following properties:

+ @@ -1573,7 +1895,25 @@ controlled from the rest.

- + + + + + + + + + + + + + + + + + + + @@ -1586,7 +1926,9 @@ controlled from the rest.

Use this rule and customize it:

<rule ref="category/apex/codestyle.xml/MethodNamingConventions">
     <properties>
-        <property name="skipTestMethodUnderscores" value="false" />
+        <property name="testPattern" value="[a-z][a-zA-Z0-9]*" />
+        <property name="staticPattern" value="[a-z][a-zA-Z0-9]*" />
+        <property name="instancePattern" value="[a-z][a-zA-Z0-9]*" />
     </properties>
 </rule>
 
@@ -1672,8 +2014,92 @@ can lead to quite messy code. This rule looks for several declarations on the sa </rule> +

PropertyNamingConventions

+ +

Since: PMD 6.15.0

+ +

Priority: High (1)

+ +

Configurable naming conventions for property declarations. This rule reports +property declarations which do not match the regex that applies to their +specific kind (e.g. static property, or instance property). Each regex can be +configured through properties.

+ +

By default this rule uses the standard Apex naming convention (Camel case).

+ +

This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.PropertyNamingConventionsRule

+ +

Example(s):

+ +
public class Foo {
+    public Integer instanceProperty { get; set; } // This is in camel case, so it's ok
+
+    public Integer INSTANCE_PROPERTY { get; set; } // This will be reported unless you change the regex
+}
+
+ +

This rule has the following properties:

+ +
skipTestMethodUnderscores falseSkip underscores in test methodsDeprecated Skip underscores in test methodsno
testPattern[a-z][a-zA-Z0-9]*Regex which applies to test method namesno
staticPattern[a-z][a-zA-Z0-9]*Regex which applies to static method namesno
instancePattern[a-z][a-zA-Z0-9]*Regex which applies to instance method names no
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefault ValueDescriptionMultivalued
cc_categoriesStyleDeprecated Code Climate Categoriesyes. Delimiter is ‘|’.
cc_remediation_points_multiplier1Deprecated Code Climate Remediation Points multiplierno
cc_block_highlightingfalseDeprecated Code Climate Block Highlightingno
staticPattern[a-z][a-zA-Z0-9]*Regex which applies to static property namesno
instancePattern[a-z][a-zA-Z0-9]*Regex which applies to instance property namesno
+ +

Use this rule with the default properties by just referencing it:

+
<rule ref="category/apex/codestyle.xml/PropertyNamingConventions" />
+
+ +

Use this rule and customize it:

+
<rule ref="category/apex/codestyle.xml/PropertyNamingConventions">
+    <properties>
+        <property name="staticPattern" value="[a-z][a-zA-Z0-9]*" />
+        <property name="instancePattern" value="[a-z][a-zA-Z0-9]*" />
+    </properties>
+</rule>
+
+

VariableNamingConventions

+

Deprecated

+

Since: PMD 5.5.0

Priority: High (1)

@@ -1682,6 +2108,12 @@ can lead to quite messy code. This rule looks for several declarations on the sa checks for final variables that should be fully capitalized and non-final variables that should not include underscores.

+

This rule is deprecated and will be removed with PMD 7.0.0. The rule is replaced +by the more general rules quot, +quot, +quot, and +quot.

+

This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.VariableNamingConventionsRule

Example(s):

diff --git a/search.json b/search.json index 186627c625..e1ced3bb62 100644 --- a/search.json +++ b/search.json @@ -1011,6 +1011,15 @@ } , +{ +"title": "FieldNamingConventions (Apex, Code Style)", +"tags": "", +"keywords": "FieldNamingConventions", +"url": "pmd_rules_apex_codestyle.html#fieldnamingconventions", +"summary": "Rules which enforce a specific coding style." +} +, + { "title": "ForLoopsMustUseBraces (Apex, Code Style)", "tags": "", @@ -1020,6 +1029,24 @@ } , +{ +"title": "FormalParameterNamingConventions (Apex, Code Style)", +"tags": "", +"keywords": "FormalParameterNamingConventions", +"url": "pmd_rules_apex_codestyle.html#formalparameternamingconventions", +"summary": "Rules which enforce a specific coding style." +} +, + +{ +"title": "LocalVariableNamingConventions (Apex, Code Style)", +"tags": "", +"keywords": "LocalVariableNamingConventions", +"url": "pmd_rules_apex_codestyle.html#localvariablenamingconventions", +"summary": "Rules which enforce a specific coding style." +} +, + { "title": "MethodNamingConventions (Apex, Code Style)", "tags": "", @@ -1038,6 +1065,15 @@ } , +{ +"title": "PropertyNamingConventions (Apex, Code Style)", +"tags": "", +"keywords": "PropertyNamingConventions", +"url": "pmd_rules_apex_codestyle.html#propertynamingconventions", +"summary": "Rules which enforce a specific coding style." +} +, + { "title": "VariableNamingConventions (Apex, Code Style)", "tags": "",