dart-code-metrics icon indicating copy to clipboard operation
dart-code-metrics copied to clipboard

[Rule change] long-parameters-list - ignore optional prameters

Open NaikSoftware opened this issue 2 years ago • 4 comments

Its normal to have 5+ parameters in flutter if only 1..3 required. For example: image Typical API request - only 3 parameters required, but we need to have ability to customize some parameters sometimes.

I think this rule created for avoiding functionCall(p1, p1, p3...., p5) but it is not my case. Without this rule change our team can't use it.

P.S.: especially dart analysis message sounds like info: Long Parameter List. This method require 5 arguments.

NaikSoftware avatar Oct 08 '21 09:10 NaikSoftware

@NaikSoftware I totally disagree change default behaviour, but we can discuss about add anti-pattern option for skip optional arguments.

dkrutskikh avatar Oct 08 '21 17:10 dkrutskikh

@dkrutskikh warning message say: 'require 5 parameters' but really require only 3.

NaikSoftware avatar Oct 08 '21 17:10 NaikSoftware

@NaikSoftware do you mean we need only to change message?

dkrutskikh avatar Oct 08 '21 17:10 dkrutskikh

@dkrutskikh personally I need setting to ignore optional params in this rule

NaikSoftware avatar Oct 29 '21 14:10 NaikSoftware

Closing as duplicate of #420

incendial avatar Oct 31 '22 19:10 incendial