Skip to content

Commit 4c20d34

Browse files
author
ABaldwinHunter
committed
Tune remediation points
Tune complexity points, following calculation function in codeclimate-eslint, and creating more parity with Ruby analysis in Code Climate classic.
1 parent 038705e commit 4c20d34

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

config/cops.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
1+
# Method checks
12
Metrics/AbcSize:
3+
base_points: 1_000_000
24
violation_points: 100_000
35
Metrics/BlockNesting:
4-
base_points: 30_000
6+
base_points: 100_000
7+
Metrics/CyclomaticComplexity: # This check is per method
8+
base_points: 1_000_000
9+
violation_points: 100_000
10+
Metrics/ParameterList:
11+
base_points: 500_000
12+
violation_points: 100_000
13+
Metrics/PerceivedComplexity:
14+
base_points: 1_000_000
15+
violation_points: 100_000
16+
Metrics/MethodLength:
17+
base_points: 1_000_000
18+
violation_points: 70_000
19+
20+
# Class / Module checks
521
Metrics/ClassLength:
6-
base_points: 400_000
7-
Metrics/CyclomaticComplexity:
8-
base_points: 75_000
9-
violation_points: 10_000
22+
base_points: 5_000_000
23+
violation_points: 35_000
24+
Metrics/ModuleLength:
25+
base_points: 5_000_000
26+
violation_points: 35_000
27+
28+
# Other
1029
Metrics/LineLength:
11-
base_points: 20_000
12-
violation_points: 5_000
13-
Metrics/MethodLength:
14-
base_points: 50_000
30+
base_points: 100_000
1531
violation_points: 10_000
16-
Metrics/ModuleLength:
17-
base_points: 500_000
18-
violation_points: 5_000
19-
Metrics/ParameterList:
20-
base_points: 10_000
21-
violation_points: 50_000
22-
Metrics/PerceivedComplexity:
23-
base_points: 50_000
24-
violation_points: 5000

spec/cc/engine/rubocop_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def includes_check?(output, cop_name)
323323
def includes_content_for?(output, cop_name)
324324
issue = issues(output).detect { |i| i["check_name"] =~ /#{cop_name}$/ }
325325

326-
issue["content"]["body"].present?
326+
issue["content"] && issue["content"]["body"].present?
327327
end
328328

329329
def issues(output)

0 commit comments

Comments
 (0)