Sha256: f986fa3d1c7599195106946b176992bf1c8520c7ecc3def284b45e8acedc7556
Contents?: true
Size: 515 Bytes
Versions: 8
Compression:
Stored size: 515 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
8 entries across 8 versions & 1 rubygems