Sha256: 34918420ecf540a36961d3dfbef439d0034d68975692fc7d991fbfc94287a55c
Contents?: true
Size: 867 Bytes
Versions: 28
Compression:
Stored size: 867 Bytes
Contents
# frozen_string_literal: true require_relative 'base_detector' module Reek module SmellDetectors # # 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. class IrresponsibleModule < BaseDetector def self.contexts [:casgn, :class, :module] end # # Checks the given class or module for a descriptive comment. # # @return [Array<SmellWarning>] # def sniff return [] if descriptive_context? || context.namespace_module? [smell_warning( lines: [source_line], message: 'has no descriptive comment')] end private def descriptive_context? context.descriptively_commented? end end end end
Version data entries
28 entries across 26 versions & 2 rubygems