credo
credo copied to clipboard
Add Warning Check to Evaluate Total Field amount in Structs
This PR introduces a new Warning Check that evaluates structs to check to see if they contain a reasonable number of fields. Structs are stored as flat maps if they have fewer than 32 fields. However, the Erlang VM stores structs with greater than 32 fields as hash maps. This can potentially lead to bloating and higher memory usage.
Structs with more than 32 fields are considered an anti-pattern in the official Elixir documentation.
Hi, I like the idea behind this check.
Will try to review as soon as I can 👍