class MetricFu::ChurnHotspot

Constants

COLUMNS

Public Instance Methods

calculate_score(metric_ranking, item) click to toggle source
# File lib/metric_fu/metrics/churn/hotspot.rb, line 24
def calculate_score(metric_ranking, item)
  flat_churn_score = 0.50
  metric_ranking.scored?(item) ? flat_churn_score : 0
end
columns() click to toggle source
# File lib/metric_fu/metrics/churn/hotspot.rb, line 4
def columns
  COLUMNS
end
generate_records(data, table) click to toggle source
# File lib/metric_fu/metrics/churn/hotspot.rb, line 29
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_strategy() click to toggle source
# File lib/metric_fu/metrics/churn/hotspot.rb, line 12
def map_strategy
  :present
end
name() click to toggle source
# File lib/metric_fu/metrics/churn/hotspot.rb, line 8
def name
  :churn
end
present_group(group) click to toggle source
# File lib/metric_fu/metrics/churn/hotspot.rb, line 40
def present_group(group)
  "detected high level of churn (changed #{group[0].times_changed} times)"
end
reduce_strategy() click to toggle source
# File lib/metric_fu/metrics/churn/hotspot.rb, line 16
def reduce_strategy
  :sum
end
score_strategy() click to toggle source
# File lib/metric_fu/metrics/churn/hotspot.rb, line 20
def score_strategy
  :calculate_score
end