Sha256: 6fb359c91cb77a2a35d249764cdd0b3a4f5536150222b1cb831ed5b4f972b377
Contents?: true
Size: 521 Bytes
Versions: 6
Compression:
Stored size: 521 Bytes
Contents
# frozen_string_literal: true module Attractor # makes suggestions for refactorings class Suggester def initialize(values) @values = values || [] end def suggest(threshold = 95) products = @values.map { |val| val.churn * val.complexity } products.extend(DescriptiveStatistics) quantile = products.percentile(threshold.to_i) @values.select { |val| val.churn * val.complexity > quantile } .sort_by { |val| val.churn * val.complexity }.reverse end end end
Version data entries
6 entries across 6 versions & 1 rubygems