class ChurnAnalyzer

Constants

COLUMNS

Public Instance Methods

columns() click to toggle source
# File lib/base/churn_analyzer.rb, line 6
def columns
  COLUMNS
end
generate_records(data, table) click to toggle source
# File lib/base/churn_analyzer.rb, line 27
def generate_records(data, table)
 return if data==nil
  Array(data[:changes]).each do |change|
    table << {
      "metric" => :churn,
      "times_changed" => change[:times_changed],
      "file_path" => change[:file_path]
    }
  end
end
map(row) click to toggle source
# File lib/base/churn_analyzer.rb, line 14
def map(row)
  ScoringStrategies.present(row)
end
name() click to toggle source
# File lib/base/churn_analyzer.rb, line 10
def name
  :churn
end
reduce(scores) click to toggle source
# File lib/base/churn_analyzer.rb, line 18
def reduce(scores)
  ScoringStrategies.sum(scores)
end
score(metric_ranking, item) click to toggle source
# File lib/base/churn_analyzer.rb, line 22
def score(metric_ranking, item)
  flat_churn_score = 0.50
  metric_ranking.scored?(item) ? flat_churn_score : 0
end