samples/rubycritic/analysed_module.rb in skunk-0.3.0 vs samples/rubycritic/analysed_module.rb in skunk-0.3.1

- old
+ new

@@ -29,19 +29,11 @@ # When `churn_times_cost` is 100 and module is covered at 75%: # stink_score => 100 * 25 (percentage uncovered) = 2_500 # # @return [Float] def stink_score - return churn_times_cost.round(2) if coverage == PERFECT_COVERAGE + return cost.round(2) if coverage == PERFECT_COVERAGE - (churn_times_cost * (PERFECT_COVERAGE - coverage.to_i)).round(2) - end - - # Returns the value of churn times cost. - # - # @return [Integer] - def churn_times_cost - safe_churn = churn.positive? ? churn : 1 - @churn_times_cost ||= safe_churn * cost + (cost * (PERFECT_COVERAGE - coverage.to_i)).round(2) end end end