Class: RuboCop::Cop::Metz::MethodsTooManyParameters

Inherits:
Base
  • Object
show all
Extended by:
Metz::CopMetadata, ExcludeLimit
Defined in:
lib/rubocop/cop/metz/methods_too_many_parameters.rb

Overview

Flags methods whose parameter list exceeds the configured Max. Counts positional, optional, rest, keyword, and keyword-rest parameters using the same rule as core's Metrics/ParameterLists, with a stricter Metz default of 4.

Constant Summary collapse

MSG =
"Avoid parameter lists longer than %<max>d parameters. [%<count>d/%<max>d]"

Constants included from Metz::CopMetadata

Metz::CopMetadata::DEFAULT_FIX_SAFETY, Metz::CopMetadata::DEFAULT_SUGGESTED_NEXT_MOVES, Metz::CopMetadata::DEFAULT_WHY_IT_MATTERS

Instance Method Summary collapse

Methods included from Metz::CopMetadata

fix_safety, included, metz_metadata, suggested_next_moves, why_it_matters

Instance Method Details

#on_args(node) ⇒ Object



29
30
31
32
33
# File 'lib/rubocop/cop/metz/methods_too_many_parameters.rb', line 29

def on_args(node)
  return unless method_definition_args?(node)

  register_offense(node, args_count(node))
end