From c8645440f2d6d1547d86c988afc414573a010ce9 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 9 Dec 2017 10:24:30 +0100 Subject: [PATCH] Update release notes with new rules --- docs/pages/release_notes.md | 7 +++++++ pmd-core/src/main/resources/rulesets/releases/600.xml | 1 + .../src/main/resources/category/java/bestpractices.xml | 2 +- pmd-java/src/main/resources/category/java/design.xml | 4 ++-- pmd-java/src/main/resources/category/java/errorprone.xml | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 30c38e8bee..ff50b0ccfe 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -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. diff --git a/pmd-core/src/main/resources/rulesets/releases/600.xml b/pmd-core/src/main/resources/rulesets/releases/600.xml index f2c145af90..4ffa27dd8d 100644 --- a/pmd-core/src/main/resources/rulesets/releases/600.xml +++ b/pmd-core/src/main/resources/rulesets/releases/600.xml @@ -12,6 +12,7 @@ This ruleset contains links to rules that are new in PMD v6.0.0 + diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 236dd78dcc..a649c9aa47 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -353,7 +353,7 @@ public class Foo { @@ -919,7 +919,7 @@ public class Foo extends Bar { diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index 1cc2ef6ad6..2afdc6a818 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -1209,7 +1209,7 @@ public void foo() {