Class: ImproveYourCode::SmellDetectors::UnusedPrivateMethod
- Inherits:
-
BaseDetector
- Object
- BaseDetector
- ImproveYourCode::SmellDetectors::UnusedPrivateMethod
- Defined in:
- lib/improve_your_code/smell_detectors/unused_private_method.rb
Defined Under Namespace
Classes: Hit
Constant Summary
Constants inherited from BaseDetector
Instance Attribute Summary
Attributes inherited from BaseDetector
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from BaseDetector
configuration_keys, descendants, inherited, #initialize, #run, #smell_type, smell_type, to_detector, todo_configuration_for, valid_detector?
Constructor Details
This class inherits a constructor from ImproveYourCode::SmellDetectors::BaseDetector
Class Method Details
.contexts ⇒ Object
21 22 23 |
# File 'lib/improve_your_code/smell_detectors/unused_private_method.rb', line 21 def self.contexts [:class] end |
.default_config ⇒ Object
8 9 10 |
# File 'lib/improve_your_code/smell_detectors/unused_private_method.rb', line 8 def self.default_config super.merge(SmellConfiguration::ENABLED_KEY => false) end |
Instance Method Details
#sniff ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/improve_your_code/smell_detectors/unused_private_method.rb', line 25 def sniff hits.map do |hit| name = hit.name smell_warning( context: context, lines: [hit.line], message: "has the unused private instance method '#{name}'", parameters: { name: name.to_s } ) end end |