Class: RuboCop::Cop::Kaizo::TotalArguments
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Kaizo::TotalArguments
- Includes:
- ArgumentCounting
- Defined in:
- lib/rubocop/cop/kaizo/total_arguments.rb
Overview
Checks that a method does not declare too many arguments in total (positional plus keyword).
The goal is to apply pressure toward good domain modeling: a long argument list is often a sign of primitive obsession, and bundling the related values into an object usually expresses the intent better.
*rest, **keyword-rest, and &block arguments are not counted. The
initialize of a Struct.new/Data.define block is exempt, since those
parameters mirror the value object's attributes.
Constant Summary collapse
- KIND =
"arguments".freeze
Constants included from ArgumentCounting
ArgumentCounting::DEFINE_METHODS, ArgumentCounting::KEYWORD_TYPES, ArgumentCounting::MSG, ArgumentCounting::POSITIONAL_TYPES, ArgumentCounting::STRUCT_OR_DATA