solid-software / solid_lints

🟧 Lints for Dart and Flutter based on software industry standards and best practices.
Other
36 stars 18 forks source link

Add number of parameters metric #31

Closed n-bernat closed 1 year ago

n-bernat commented 1 year ago

PR which allows the capability to check whether we excedeed the maximum allowed number of parameters. As a first new lint it also contains a proposal for organising the code.

One thing to consider: In my opinion having custom models for lints is not necessary, operating on primitives like:

custom_lint:
  rules:
    - cyclomatic_complexity_metric: 4
    - number_of_parameters: 2

should be good enough for us.

Current configuration for custom lints looks like that:

custom_lint:
  rules:
    - cyclomatic_complexity_metric:
      max_complexity: 4
    - number_of_parameters:
      max_parameters: 2

and requires custom models for each rule. It feels like an overkill for me, because we will end up with a bunch of models that have only one field in them.