class Central::Devtools::Flay::Scale

Measure flay mass relative to size of duplicated sexps

Public Instance Methods

flay_report() click to toggle source

Report flay output

@return [undefined] @api private

# File lib/central/devtools/flay.rb, line 26
def flay_report
  flay.report
end
measure() click to toggle source

Measure duplication mass

@return [Array<Rational>] @api private

# File lib/central/devtools/flay.rb, line 16
def measure
  flay.masses.map do |hash, mass|
    Rational(mass, flay.hashes.fetch(hash).size)
  end
end

Private Instance Methods

flay() click to toggle source

Memoized flay instance

@return [Flay] @api private

# File lib/central/devtools/flay.rb, line 36
def flay
  ::Flay.new(mass: minimum_mass).tap do |flay|
    flay.process(*files)
    flay.analyze
  end
end