Sha256: 77eb56e7fba7f63c688db60755acb6fba0b7984bde5267ca5726fbaff915d241
Contents?: true
Size: 783 Bytes
Versions: 9
Compression:
Stored size: 783 Bytes
Contents
class MetricFu::ChurnHotspot < MetricFu::Hotspot COLUMNS = %w{times_changed} def columns COLUMNS end def name :churn end def map_strategy :present end def reduce_strategy :sum end def score_strategy :calculate_score end def calculate_score(metric_ranking, item) flat_churn_score = 0.50 metric_ranking.scored?(item) ? flat_churn_score : 0 end 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 def present_group(group) "detected high level of churn (changed #{group[0].times_changed} times)" end end
Version data entries
9 entries across 9 versions & 3 rubygems