Skip to content

Commit ebc4c09

Browse files
Use sum directly
1 parent 292b7c0 commit ebc4c09

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/skunk/cli/commands/status_reporter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def sorted_modules
5454
end
5555

5656
def total_stink_score
57-
@total_stink_score ||= non_test_modules.map(&:stink_score).inject(0.0, :+)
57+
@total_stink_score ||= non_test_modules.sum(&:stink_score)
5858
end
5959

6060
def total_churn_times_cost
61-
non_test_modules.map(&:churn_times_cost).sum
61+
non_test_modules.sum(&:churn_times_cost)
6262
end
6363

6464
def stink_score_average

lib/skunk/rubycritic/analysed_modules_collection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class AnalysedModulesCollection
88
def stink_score_average
99
num_modules = @modules.size
1010
if num_modules.positive?
11-
map(&:stink_score).reduce(:+) / num_modules.to_f
11+
sum(&:stink_score) / num_modules.to_f
1212
else
1313
0.0
1414
end

0 commit comments

Comments
 (0)