You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: I picked 5 as the default basically randomly. If the implementor can do a proper analysis of some public Erlang codebases to determine what a reasonable default should be, much better.
Reasoning
Quoting from Credo docs:
A function can take as many parameters as needed, but even in a functional language, there can be too many parameters.
8 sounds reasonable as a default. In a team I used to work in we had 7 as a "rule of thumb" 👍 Then you had to use maps or records, or otherwise work around it :) Most of the initial cases it was just people adding options as new arguments :)
Max Function Arity
Brief Description
Warn if a function has too many arguments.
Should be on by default?
YES
Options
max_arity :: pos_integer()
(default:5
)Note: I picked
5
as the default basically randomly. If the implementor can do a proper analysis of some public Erlang codebases to determine what a reasonable default should be, much better.Reasoning
Quoting from Credo docs:
Origin (#281)
Inspired by the
Refactor.FunctionArity
rule from CredoThe text was updated successfully, but these errors were encountered: