Skip to content

builtin.size.param-count

FieldValue
idbuiltin.size.param-count
severitywarn
categorysize
scopefile
languagesrust, python, go, java, typescript, tsx, javascript
evaluatorbuiltin / param_count

Long parameter lists are a smell: usually the function is doing too much, or the call site is missing an aggregate type that should obviously exist. They’re also a maintenance hazard — every additional parameter multiplies the number of call sites that need updating when the contract changes.

Configure under [size] in .sextant/config.toml:

[size]
param_count_warn = 6
param_count_error = 10
SettingDefaultEffect
param_count_warn6Functions with this many parameters trigger a warn.
param_count_error10Functions with this many escalate to error.

The count is over declared parameters. &self / &mut self / self count. Default arguments count.

  • Group related arguments into a struct (Config, Options, request type). Two arguments that always travel together are already a struct in disguise.
  • Promote optional parameters into a builder if there are more than a few.
  • For methods with many &mut self arguments plus extras, consider whether some of those extras belong as fields on Self.