Sha256: d7682e25125520a69c13991247a9ea1518cd35b370a47cac453f15b91e1c8a95

Contents?: true

Size: 780 Bytes

Versions: 10

Compression:

Stored size: 780 Bytes

Contents

module MetricFu
  
  class ReekGrapher < Grapher
    
    attr_accessor :reek_count, :labels
    
    def initialize
      super
      @reek_count = {}
      @labels = {}
    end
    
    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
    
  end
  
end

Version data entries

10 entries across 10 versions & 6 rubygems

Version Path
cayblood-metric_fu-1.1.6 lib/graphs/reek_grapher.rb
metric_fu-1.5.0 lib/graphs/reek_grapher.rb
metric_fu-1.4.0 lib/graphs/reek_grapher.rb
devver-metric_fu-1.3.3 lib/graphs/reek_grapher.rb
nielsm-metric_fu-1.3.1 lib/graphs/reek_grapher.rb
metric_fu-1.3.0 lib/graphs/reek_grapher.rb
edouard-metric_fu-1.2.1 lib/graphs/reek_grapher.rb
edouard-metric_fu-1.2.0 lib/graphs/reek_grapher.rb
metric_fu-1.2.0 lib/graphs/reek_grapher.rb
flyerhzm-metric_fu-1.0.0 lib/graphs/reek_grapher.rb