From 63c7ac519d9de8525826475b02c6a8f6164823a3 Mon Sep 17 00:00:00 2001 From: ABaldwinHunter Date: Mon, 21 Dec 2015 21:58:33 -0500 Subject: [PATCH 1/2] Tune remediation points Tune complexity points, creating more parity with Ruby analysis in Code Climate classic. - Class violations: 5_000_000 + n35_000 - Method violations: 1_000_000 + n70_000 --- config/cops.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/config/cops.yml b/config/cops.yml index abf45d3f..450e5d70 100644 --- a/config/cops.yml +++ b/config/cops.yml @@ -1,24 +1,25 @@ Metrics/AbcSize: - violation_points: 100_000 + base_points: 1_000_000 + violation_points: 70_000 Metrics/BlockNesting: - base_points: 30_000 + base_points: 100_000 Metrics/ClassLength: - base_points: 400_000 -Metrics/CyclomaticComplexity: - base_points: 75_000 - violation_points: 10_000 + base_points: 5_000_000 + violation_points: 35_000 +Metrics/CyclomaticComplexity: # This check is per method + base_points: 1_000_000 + violation_points: 70_000 Metrics/LineLength: - base_points: 20_000 - violation_points: 5_000 -Metrics/MethodLength: base_points: 50_000 - violation_points: 10_000 +Metrics/MethodLength: + base_points: 1_000_000 + violation_points: 70_000 Metrics/ModuleLength: - base_points: 500_000 - violation_points: 5_000 + base_points: 5_000_000 + violation_points: 35_000 Metrics/ParameterList: - base_points: 10_000 - violation_points: 50_000 + base_points: 500_000 + violation_points: 100_000 Metrics/PerceivedComplexity: - base_points: 50_000 - violation_points: 5000 + base_points: 1_000_000 + violation_points: 70_000 From 342a501db842079e565c5a5e612fe94bd82ea954 Mon Sep 17 00:00:00 2001 From: ABaldwinHunter Date: Mon, 28 Dec 2015 15:15:08 -0500 Subject: [PATCH 2/2] Add nil guard in spec --- spec/cc/engine/rubocop_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/cc/engine/rubocop_spec.rb b/spec/cc/engine/rubocop_spec.rb index 2c1bb46f..86932002 100644 --- a/spec/cc/engine/rubocop_spec.rb +++ b/spec/cc/engine/rubocop_spec.rb @@ -323,7 +323,7 @@ def includes_check?(output, cop_name) def includes_content_for?(output, cop_name) issue = issues(output).detect { |i| i["check_name"] =~ /#{cop_name}$/ } - issue["content"]["body"].present? + issue["content"] && issue["content"]["body"].present? end def issues(output)