Sha256: 3739b47d53763a2e59f19b4d1dfc8d336e25d2f9f4fd279773842bf9d536fd6d

Contents?: true

Size: 491 Bytes

Versions: 9

Compression:

Stored size: 491 Bytes

Contents

module MetricFu
  module HotspotScoringStrategies
    module_function

    # per project score percentile
    def percentile(ranking, item)
      ranking.percentile(item)
    end

    # Use the score you got
    #   (ex flog score of 20 is not bad even if it is the top one in project)
    def identity(ranking, item)
      ranking.fetch(item)
    end

    def sum(scores)
      scores.inject(&:+)
    end

    def average(scores)
      sum(scores).to_f / scores.size.to_f
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
metric_fu-4.13.0 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb
fastruby-metric_fu-5.0.0 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb
code_metric_fu-4.14.4 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb
code_metric_fu-4.14.3 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb
code_metric_fu-4.14.2 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb
code_metric_fu-4.14.1 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb
code_metric_fu-4.14.0 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb
metric_fu-4.12.0 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb
metric_fu-4.11.4 lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb