elvis_core
elvis_core copied to clipboard
Possible New Rules: Code Complexity
Inspired by https://hexdocs.pm/credo/Credo.Check.Refactor.ABCSize.html
Read the comments below to find more possible rules :)
There's also https://hexdocs.pm/credo/Credo.Check.Refactor.CyclomaticComplexity.html in a similar spirit.
And https://hexdocs.pm/credo/Credo.Check.Refactor.PerceivedComplexity.html.
The assignments (A) part probably needs to be weighted differently for Erlang versus other languages. For example, I do WAY fewer assignments in Elixir than in Erlang, because in Elixir, there are pipes, and in Erlang there's a bunch of intermediate variables.
Agreed. This could probably be released initially as experimental
(something I'm not sure we've ever done in elvis_core
) and then tweaked with community feedback.