Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible New Rules: Code Complexity #285

Open
elbrujohalcon opened this issue Feb 28, 2023 · 4 comments
Open

Possible New Rules: Code Complexity #285

elbrujohalcon opened this issue Feb 28, 2023 · 4 comments
Labels
Milestone

Comments

@elbrujohalcon
Copy link
Member

elbrujohalcon commented Feb 28, 2023

Inspired by https://hexdocs.pm/credo/Credo.Check.Refactor.ABCSize.html

Read the comments below to find more possible rules :)

@elbrujohalcon elbrujohalcon added this to the 3.1.0 milestone Feb 28, 2023
@paulo-ferraz-oliveira
Copy link
Collaborator

There's also https://hexdocs.pm/credo/Credo.Check.Refactor.CyclomaticComplexity.html in a similar spirit.

@paulo-ferraz-oliveira
Copy link
Collaborator

@maco
Copy link
Collaborator

maco commented Feb 28, 2023

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.

@paulo-ferraz-oliveira
Copy link
Collaborator

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.

@elbrujohalcon elbrujohalcon changed the title Possible New Rule: Max ABC Size Possible New Rules: Code Complexity Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants