Sha256: b215adf3e1bc030e0ff1089b9769b5e70fba4f6df5ed17b62d6722cf324a50b3

Contents?: true

Size: 907 Bytes

Versions: 7

Compression:

Stored size: 907 Bytes

Contents

class RcovAnalyzer
  include ScoringStrategies

  COLUMNS = %w{percentage_uncovered}

  def columns
    COLUMNS
  end

  def name
    :rcov
  end

  def map(row)
    row.percentage_uncovered
  end

  def reduce(scores)
    ScoringStrategies.average(scores)
  end

  def score(metric_ranking, item)
    ScoringStrategies.identity(metric_ranking, item)
  end

  def generate_records(data, table)
   return if data==nil
   data.each do |file_name, info|
     next if (file_name == :global_percent_run) || (info[:methods].nil?)
     info[:methods].each do |method_name, percentage_uncovered|
       location = MetricFu::Location.for(method_name)
       table << {
         "metric" => :rcov,
         'file_path' => file_name,
         'class_name' => location.class_name,
         "method_name" => location.method_name,
         "percentage_uncovered" => percentage_uncovered
       }
     end
   end
 end

end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
danmayer-metric_fu-2.1.3 lib/base/rcov_analyzer.rb
danmayer-metric_fu-2.1.2 lib/base/rcov_analyzer.rb
rferraz-metric_fu-2.1.2 lib/base/rcov_analyzer.rb
rferraz-metric_fu-2.1.1 lib/base/rcov_analyzer.rb
metric_fu-2.1.1 lib/base/rcov_analyzer.rb
metric_fu-2.1.0 lib/base/rcov_analyzer.rb
metric_fu-2.0.1 lib/base/rcov_analyzer.rb