Sha256: 1575e3e21b128fb9e2e60b80b55f74d6f57c78adecfb96be4fdd40f9d505e2dc
Contents?: true
Size: 737 Bytes
Versions: 27
Compression:
Stored size: 737 Bytes
Contents
# frozen_string_literal: true require_relative 'base_detector' module Reek module SmellDetectors # # Methods should use their parameters. # # See {file:docs/Unused-Parameters.md} for details. class UnusedParameters < BaseDetector # # Checks whether the given method has any unused parameters. # # @return [Array<SmellWarning>] # def sniff return [] if context.uses_super_with_implicit_arguments? context.unused_params.map do |param| name = param.name.to_s smell_warning( lines: [source_line], message: "has unused parameter '#{name}'", parameters: { name: name }) end end end end end
Version data entries
27 entries across 25 versions & 2 rubygems