class MetricFu::ReekGrapher

Attributes

labels[RW]
reek_count[RW]

Public Class Methods

new() click to toggle source
Calls superclass method MetricFu::Grapher::new
# File lib/graphs/reek_grapher.rb, line 5
def initialize
  super
  @reek_count = {}
  @labels = {}
end

Public Instance Methods

get_metrics(metrics, date) click to toggle source
# File lib/graphs/reek_grapher.rb, line 11
def get_metrics(metrics, date)
  if metrics && metrics[:reek]
    counter = @labels.size
    @labels.update( { @labels.size => date })

    metrics[:reek][:matches].each do |reek_chunk|
      reek_chunk[:code_smells].each do |code_smell|
        # speaking of code smell...
        @reek_count[code_smell[:type]] = [] if @reek_count[code_smell[:type]].nil?
        if @reek_count[code_smell[:type]][counter].nil?
          @reek_count[code_smell[:type]][counter] = 1
        else
          @reek_count[code_smell[:type]][counter] += 1
        end
      end
    end
  end
end