Module: ChurnVsComplexity::GammaScore

Defined in:
lib/churn_vs_complexity/gamma_score.rb

Constant Summary collapse

EPSILON =
0.0001

Class Method Summary collapse

Class Method Details

.calculate(churn, complexity) ⇒ Object



7
8
9
10
11
# File 'lib/churn_vs_complexity/gamma_score.rb', line 7

def self.calculate(churn, complexity)
  c = churn.to_f + EPSILON
  x = complexity.to_f + EPSILON
  (2 * c * x) / (c + x)
end