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
ABC size with Ecto query #561
Comments
@Apelsinka223 You are right! 👍 |
@rrrene want me to take a look at how this could work smoother? |
@roehst sure. The challenge will be how we can differentiate between cases where the check should raise an issue and where it doesn't. What are your thoughts on a solution here? White-listing some funs? Looking forward to hearing your thoughts! |
The table names Variable bindings and formal parameters are saved in the accumulator of the AST traversal in var_names. Options:
Comments, @rrrene ? |
- The Ecto DSL inflates the ABC metric as in rrrene#561. - This patch adds minimal white-listing capabilities as a quick fix.
I seem to be still getting this issue. Elixir 1.8.2 (compiled with Erlang/OTP 22) |
Possible approach to this: If Ecto.Query is imported in the file, automatically ignore the problematic ecto functions. That would reduce the false positives generated by whitelisting the ecto function names across the board. |
Ignore Ecto.Query functions in ABCSize when Ecto.Query is imported. Fixes #561.
Environment
mix credo -v
): 0.9.0-rc8elixir -v
): 1.6.1Got a warning on this function
Function is too complex (ABC size is 34, max is 30).
Not sure if it is correct behavior, but I didn't expect that Ecto query will be taken into ABC size
The text was updated successfully, but these errors were encountered: