Class: Simplabs::Excellent::Checks::FlogClassCheck
- Defined in:
- lib/simplabs/excellent/checks/flog_class_check.rb
Overview
This check reports classes with a Flog metric score that is higher than the threshold. The Flog metric is very similar to the cyclomatic complexity measure but also takes Ruby specific statements into account. For example, calls to metaprogramming methods such as define_method or class_eval are weighted higher than regular method calls.
Excellent does not calculate the score exactly the same way as Flog does, so scores may vary. For Flog also see github.com/seattlerb/flog.
Applies to
-
classes
Constant Summary collapse
- DEFAULT_THRESHOLD =
300
Instance Attribute Summary
Attributes inherited from Base
#interesting_contexts, #interesting_files, #options, #warnings
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ FlogClassCheck
constructor
:nodoc:.
Methods inherited from FlogCheck
Methods inherited from Base
#add_warning, #evaluate_context, #warnings_for
Constructor Details
#initialize(options = {}) ⇒ FlogClassCheck
:nodoc:
23 24 25 26 |
# File 'lib/simplabs/excellent/checks/flog_class_check.rb', line 23 def initialize( = {}) #:nodoc: [:threshold] ||= DEFAULT_THRESHOLD super([Parsing::ClassContext], ) end |