class Reek::SmellDetectors::IrresponsibleModule
It is considered good practice to annotate every class and module with a brief comment outlining its responsibilities.
See {file:docs/Irresponsible-Module.md} for details.
Public Class Methods
Source
# File lib/reek/smell_detectors/irresponsible_module.rb, line 13 def self.contexts [:casgn, :class, :module] end
Public Instance Methods
Source
# File lib/reek/smell_detectors/irresponsible_module.rb, line 22 def sniff return [] if descriptive_context? || context.namespace_module? [smell_warning( lines: [source_line], message: 'has no descriptive comment')] end
Checks the given class or module for a descriptive comment.
@return [Array<SmellWarning>]
Private Instance Methods
Source
# File lib/reek/smell_detectors/irresponsible_module.rb, line 32 def descriptive_context? context.descriptively_commented? end