diff --git a/feed.xml b/feed.xml
index 012c1effe3..c33df80a2a 100644
--- a/feed.xml
+++ b/feed.xml
@@ -5,8 +5,8 @@
Note that XPath 1.0 support, the default XPath version, is deprecated since PMD 6.22.0. We highly recommend that you upgrade your rules to XPath 2.0. Please refer to the migration guide.
+The new Apex rule FieldDeclarationsShouldBeAtStart
(apex-codestyle
)
+helps to ensure that field declarations are always at the beginning of a class.
The new Apex rule UnusedLocalVariable
(apex-bestpractices
) detects unused
+local variables.
Since: PMD 6.23.0
+ +Priority: Low (5)
+ +Detects when a local variable is declared and/or assigned but not used.
+ +This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.bestpractices.UnusedLocalVariableRule
+ +Example(s):
+ +public Boolean bar(String z) {
+ String x = 'some string'; // not used
+
+ String y = 'some other string'; // used in the next line
+ return z.equals(y);
+ }
+
This rule has the following properties:
+ +Name | +Default Value | +Description | +Multivalued | +
---|---|---|---|
cc_categories | +Style | +Deprecated Code Climate Categories | +yes. Delimiter is ‘|’. | +
cc_remediation_points_multiplier | +1 | +Deprecated Code Climate Remediation Points multiplier | +no | +
cc_block_highlighting | +false | +Deprecated Code Climate Block Highlighting | +no | +
Use this rule with the default properties by just referencing it:
+<rule ref="category/apex/bestpractices.xml/UnusedLocalVariable" />
+
Since: PMD 6.23.0
+ +Priority: Medium (3)
+ +Field declarations should appear before method declarations within a class.
+ +This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.FieldDeclarationsShouldBeAtStartRule
+ +Example(s):
+ +class Foo {
+ public Integer someField; // good
+
+ public void someMethod() {
+ }
+
+ public Integer anotherField; // bad
+}
+
This rule has the following properties:
+ +Name | +Default Value | +Description | +Multivalued | +
---|---|---|---|
cc_categories | +Style | +Deprecated Code Climate Categories | +yes. Delimiter is ‘|’. | +
cc_remediation_points_multiplier | +1 | +Deprecated Code Climate Remediation Points multiplier | +no | +
cc_block_highlighting | +false | +Deprecated Code Climate Block Highlighting | +no | +
Use this rule with the default properties by just referencing it:
+<rule ref="category/apex/codestyle.xml/FieldDeclarationsShouldBeAtStart" />
+
Since: PMD 6.15.0
diff --git a/search.json b/search.json index 3d35f79548..07225732a1 100644 --- a/search.json +++ b/search.json @@ -910,6 +910,15 @@ "url": "pmd_rules_apex_bestpractices.html#debugsshoulduselogginglevel", "summary": "Rules which enforce generally accepted best practices." } +, + +{ +"title": "UnusedLocalVariable (Apex, Best Practices)", +"tags": "", +"keywords": "UnusedLocalVariable", +"url": "pmd_rules_apex_bestpractices.html#unusedlocalvariable", +"summary": "Rules which enforce generally accepted best practices." +} @@ -1809,6 +1818,15 @@ } , +{ +"title": "FieldDeclarationsShouldBeAtStart (Apex, Code Style)", +"tags": "", +"keywords": "FieldDeclarationsShouldBeAtStart", +"url": "pmd_rules_apex_codestyle.html#fielddeclarationsshouldbeatstart", +"summary": "Rules which enforce a specific coding style." +} +, + { "title": "FieldNamingConventions (Apex, Code Style)", "tags": "",