Update release notes with new rules
This commit is contained in:
@ -181,6 +181,10 @@ The rule reference documentation has been updated to reflect these changes.
|
||||
which, by using a finalizer, produces extra / unnecessary overhead to garbage collection, and should be replaced with
|
||||
`Files.newInputStream` / `Files.newOutputStream` available since java 1.7.
|
||||
|
||||
* The new Java rule `DataClass` (category `design`) detects simple data-holders without behaviour. This might indicate
|
||||
that the behaviour is scattered elsewhere and the data class exposes the internal data structure,
|
||||
which breaks encapsulation.
|
||||
|
||||
* The new Apex rule `AvoidDirectAccessTriggerMap` (category `errorprone`) helps to identify direct array access to triggers,
|
||||
which can produce bugs by either accessing non-existing indexes, or leaving them out. You should use for-each-loops
|
||||
instead.
|
||||
@ -189,6 +193,9 @@ The rule reference documentation has been updated to reflect these changes.
|
||||
and flags them. Record IDs change between environments, meaning hardcoded ids are bound to fail under a different
|
||||
setup.
|
||||
|
||||
* The new Apex rule `CyclomaticComplexity` (category `design`) detects overly complex classes and methods. The
|
||||
report threshold can be configured separately for classes and methods.
|
||||
|
||||
* A whole bunch of new rules has been added to Apex. They all fit into the category `errorprone`.
|
||||
The 5 rules are migrated for Apex from the equivalent Java rules and include:
|
||||
* `EmptyCatchBlock` to detect catch blocks completely ignoring exceptions.
|
||||
|
@ -12,6 +12,7 @@ This ruleset contains links to rules that are new in PMD v6.0.0
|
||||
<rule ref="category/java/errorprone.xml/DoNotExtendJavaLangThrowable"/>
|
||||
<rule ref="category/java/design.xml/DataClass"/>
|
||||
<rule ref="category/java/design.xml/NcssCount"/>
|
||||
<rule ref="category/java/performance.xml/AvoidFileStream"/>
|
||||
|
||||
<rule ref="category/apex/design.xml/CyclomaticComplexity" />
|
||||
<rule ref="category/apex/errorprone.xml/AvoidDirectAccessTriggerMap"/>
|
||||
|
@ -353,7 +353,7 @@ public class Foo {
|
||||
|
||||
<rule name="ForLoopCanBeForeach"
|
||||
language="java"
|
||||
since="6.0"
|
||||
since="6.0.0"
|
||||
message="This 'for' loop can be replaced by a 'foreach' loop"
|
||||
typeResolution="true"
|
||||
minimumLanguageVersion="1.5"
|
||||
|
@ -425,7 +425,7 @@ class Foo {
|
||||
</rule>
|
||||
|
||||
<rule name="DataClass"
|
||||
since="6.0"
|
||||
since="6.0.0"
|
||||
message="The class ''{0}'' is suspected to be a Data Class (WOC={1}, NOPA={2}, NOAM={3}, WMC={4})"
|
||||
class="net.sourceforge.pmd.lang.java.rule.design.DataClassRule"
|
||||
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_design.html#dataclass">
|
||||
@ -919,7 +919,7 @@ public class Foo extends Bar {
|
||||
|
||||
<rule name="NcssCount"
|
||||
message="The {0} ''{1}'' has a NCSS line count of {2}."
|
||||
since="6.0"
|
||||
since="6.0.0"
|
||||
class="net.sourceforge.pmd.lang.java.rule.design.NcssCountRule"
|
||||
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_design.html#ncsscount">
|
||||
<description>
|
||||
|
@ -1209,7 +1209,7 @@ public void foo() {
|
||||
|
||||
<rule name="DoNotExtendJavaLangThrowable"
|
||||
language="java"
|
||||
since="6.0"
|
||||
since="6.0.0"
|
||||
message="Exceptions should not extend java.lang.Throwable"
|
||||
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
||||
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_errorprone.html#donotextendjavalangthrowable">
|
||||
|
Reference in New Issue
Block a user