Class: Simplabs::Excellent::Checks::FlogCheck
- Defined in:
- lib/simplabs/excellent/checks/flog_check.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#interesting_files, #interesting_nodes, #warnings
Instance Method Summary collapse
- #evaluate(context) ⇒ Object
-
#initialize(interesting_nodes, threshold) ⇒ FlogCheck
constructor
A new instance of FlogCheck.
Methods inherited from Base
#add_warning, #evaluate_node, #warnings_for
Constructor Details
#initialize(interesting_nodes, threshold) ⇒ FlogCheck
Returns a new instance of FlogCheck.
11 12 13 14 15 |
# File 'lib/simplabs/excellent/checks/flog_check.rb', line 11 def initialize(interesting_nodes, threshold) super() @interesting_nodes = interesting_nodes @threshold = threshold end |
Instance Method Details
#evaluate(context) ⇒ Object
17 18 19 |
# File 'lib/simplabs/excellent/checks/flog_check.rb', line 17 def evaluate(context) add_warning(*warning_args(context)) unless context.flog_score <= @threshold end |