Class: MetricFu::RoodiHotspot

Inherits:
Hotspot
  • Object
show all
Defined in:
lib/metric_fu/metrics/roodi/hotspot.rb

Constant Summary collapse

COLUMNS =
%w{problems}

Instance Method Summary collapse

Methods inherited from Hotspot

analyzer_for_metric, analyzers, #get_mean, #map, #mapping_strategies, metric, #not_implemented, #reduce, #score

Instance Method Details

#columnsObject



4
5
6
# File 'lib/metric_fu/metrics/roodi/hotspot.rb', line 4

def columns
  COLUMNS
end

#generate_records(data, table) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/metric_fu/metrics/roodi/hotspot.rb', line 24

def generate_records(data, table)
  return if data == nil
  Array(data[:problems]).each do |problem|
    table << {
      "metric" => name,
      "problems" => problem[:problem],
      "file_path" => problem[:file]
    }
  end
end

#map_strategyObject



12
13
14
# File 'lib/metric_fu/metrics/roodi/hotspot.rb', line 12

def map_strategy
  :present
end

#nameObject



8
9
10
# File 'lib/metric_fu/metrics/roodi/hotspot.rb', line 8

def name
  :roodi
end

#present_group(group) ⇒ Object



35
36
37
38
# File 'lib/metric_fu/metrics/roodi/hotspot.rb', line 35

def present_group(group)
  occurences = group.size
  "found #{occurences} design problems"
end

#reduce_strategyObject



16
17
18
# File 'lib/metric_fu/metrics/roodi/hotspot.rb', line 16

def reduce_strategy
  :sum
end

#score_strategyObject



20
21
22
# File 'lib/metric_fu/metrics/roodi/hotspot.rb', line 20

def score_strategy
  :percentile
end