Sha256: 3ea0024374c68f59c3431d9e47a5760b5278dc563b6364a6305575ea5077ace9

Contents?: true

Size: 908 Bytes

Versions: 5

Compression:

Stored size: 908 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

5 entries across 5 versions & 2 rubygems

Version Path
metric_fu-2.1.3.4 lib/metrics/rcov/rcov_analyzer.rb
bf4-metric_fu-2.1.3.4 lib/base/rcov_analyzer.rb
bf4-metric_fu-2.1.3.3 lib/base/rcov_analyzer.rb
bf4-metric_fu-2.1.3.2 lib/base/rcov_analyzer.rb
bf4-metric_fu-2.1.3.1 lib/base/rcov_analyzer.rb