From 6457f67e275e40bfc23ac419def4a88a7186be74 Mon Sep 17 00:00:00 2001 From: Max Jacobson Date: Thu, 15 Dec 2016 13:40:22 -0500 Subject: [PATCH] Use stricter fingerprints for some rules We received a report that this engine produces a number of fixed/new issues on pull request comparisons. I looked at an example PR: https://codeclimate.com/github/yiisoft/yii2/pull/13113 And saw that the issues showing up as fixed/new are these three. The location reported by the underlying tool, phpmd, is fairly broad. So, for example, the `Naming/ShortMethodName` rule checks that your method names aren't too short, and reports the location as being from the beginning of the method to the end of the method. This means, with our default fingerprinting algorithm, that if you change the method _at all_, we'll generate a new fingerprint for the issue, and it will show up as fixed/new. Some phpmd rules don't include a "name", but I confirmed that these three do. --- Fingerprint.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Fingerprint.php b/Fingerprint.php index 46d41ea..4b687ff 100644 --- a/Fingerprint.php +++ b/Fingerprint.php @@ -5,6 +5,8 @@ class Fingerprint { const OVERRIDE_RULES = [ + "Controversial/CamelCaseVariableName", + "Controversial/CamelCasePropertyName", "CyclomaticComplexity", "Design/LongClass", "Design/LongMethod", @@ -16,6 +18,7 @@ class Fingerprint "Design/TooManyPublicMethods", "Design/WeightedMethodCount", "ExcessivePublicCount", + "Naming/ShortMethodName", ]; private $name; private $path;