Class: Simplabs::Excellent::Checks::MethodNameCheck
- Defined in:
- lib/simplabs/excellent/checks/method_name_check.rb
Overview
This check reports methods with bad names. Badly named methods make reading and understanding the code much harder. Method names regarded as bad are for example:
-
names that are camel cased
Applies to
-
methods
Constant Summary collapse
- DEFAULT_PATTERN =
/^[_a-z<>=\[|+-\/\*\~\%\&`\|\^]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/
Instance Attribute Summary
Attributes inherited from Base
#interesting_files, #interesting_nodes, #warnings
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ MethodNameCheck
constructor
:nodoc:.
Methods inherited from NameCheck
Methods inherited from Base
#add_warning, #evaluate_node, #warnings_for
Constructor Details
#initialize(options = {}) ⇒ MethodNameCheck
:nodoc:
21 22 23 24 |
# File 'lib/simplabs/excellent/checks/method_name_check.rb', line 21 def initialize( = {}) #:nodoc: pattern = ['pattern'] || DEFAULT_PATTERN super([:defn, :defs], pattern) end |