MetricFu::ReekGrapher

Attributes

labels[RW]
reek_count[RW]

Public Class Methods

new() click to toggle source
# File lib/graphs/reek_grapher.rb, line 7
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 13
def get_metrics(metrics, date)
  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

[Validate]

Generated with the Darkfish Rdoc Generator 2.