Class: Devtools::Rake::Flay

Inherits:
Object
  • Object
show all
Includes:
Adamantium
Defined in:
lib/devtools/rake/flay.rb

Overview

Flay metric runner

Constant Summary collapse

BELOW_THRESHOLD =
'Adjust flay threshold down to %<mass>d'
TOTAL_MISMATCH =
'Flay total is now %<mass>d, but expected %<expected>d'
ABOVE_THRESHOLD =
'%<mass>d chunks have a duplicate mass > %<threshold>d'

Instance Method Summary collapse

Instance Method Details

#verifyundefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Verify code specified by files does not violate flay expectations

Returns:

  • (undefined)

    otherwise

Raises:

  • (SystemExit)

    if a violation is found



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/devtools/rake/flay.rb', line 22

def verify
  # Run flay first to ensure the max mass matches the threshold
  below_threshold_message if below_threshold?

  total_mismatch_message if total_mismatch?

  # Run flay a second time with the threshold set
  return unless above_threshold?

  restricted_flay_scale.flay_report
  above_threshold_message
end