Sha256: f3e47ef019ea2514f08b1e28e2e47bfa3ecf6049ea9469f012b6a4dbf7353ff1

Contents?: true

Size: 1.05 KB

Versions: 16

Compression:

Stored size: 1.05 KB

Contents

class MetricFu::RcovHotspot < MetricFu::Hotspot

  COLUMNS = %w{percentage_uncovered}

  def columns
    COLUMNS
  end

  def name
    :rcov
  end

  def map_strategy
    :percentage_uncovered
  end

  def reduce_strategy
    :average
  end

  def score_strategy
    :identity
  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

  def present_group(group)
    occurences = group.size
    average_code_uncoverage = get_mean(group.column("percentage_uncovered"))
    "#{"average " if occurences > 1}uncovered code is %.1f%" % average_code_uncoverage
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
metric_fu-4.11.3 lib/metric_fu/metrics/rcov/hotspot.rb
metric_fu-4.11.2 lib/metric_fu/metrics/rcov/hotspot.rb
metric_fu-4.11.1 lib/metric_fu/metrics/rcov/hotspot.rb
metric_fu-4.11.0 lib/metric_fu/metrics/rcov/hotspot.rb
metric_fu-4.10.0 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.9.0 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.8.0 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.7.4 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.7.3 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.7.2 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.7.1 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.7.0 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.6.0 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.5.2 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.5.1 lib/metric_fu/metrics/rcov/rcov_hotspot.rb
metric_fu-4.4.4 lib/metric_fu/metrics/rcov/rcov_hotspot.rb