Sha256: 8365b91d55ff0b39330eecf6964814d72076bd4bf84f5ea69adc03be80ab2780

Contents?: true

Size: 792 Bytes

Versions: 4

Compression:

Stored size: 792 Bytes

Contents

require File.join( File.dirname( File.expand_path(__FILE__)), 'smell_detector')
require File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), 'source')

# Part of Reek's core
module Reek
  module Smells

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

      def self.contexts      # :nodoc:
        [:class]
      end

      #
      # Checks the given class or module for a descriptive comment.
      # Remembers any smells found.
      #
      def examine_context(ctx)
        comment = Source::CodeComment.new(ctx.exp.comments)
        found(ctx, "has no descriptive comment") unless comment.is_descriptive?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reek-1.2.7.3 lib/reek/smells/irresponsible_module.rb
reek-1.2.7.2 lib/reek/smells/irresponsible_module.rb
reek-1.2.7.1 lib/reek/smells/irresponsible_module.rb
reek-1.2.7 lib/reek/smells/irresponsible_module.rb