Parent

Class/Module Index [+]

Quicksearch

Reek::Smells::IrresponsibleModule

It is considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Public Instance Methods

examine_context(ctx) click to toggle source

Checks the given class or module for a descriptive comment.

@return [Array<SmellWarning>]

# File lib/reek/smells/irresponsible_module.rb, line 27
def examine_context(ctx)
  comment = Source::CodeComment.new(ctx.exp.comments)
  return [] if comment.is_descriptive?
  smell = SmellWarning.new(SMELL_CLASS, ctx.full_name, [ctx.exp.line],
    'has no descriptive comment',
    @source, SMELL_SUBCLASS, {MODULE_NAME_KEY => ctx.exp.text_name})
  [smell]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.