You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a more sophisticated version of #266, but it's also more heuristic (thus the possibility of emitting false positives).
The idea is for Elvis to use some sound-alike algorithm to find variables with similar names, like MyVar and My_Var, or MyVar and MyVariable, or MyID and My_id, etc…
Should be on by default?
NO, unless we find a suitable default with a very low false positive rate.
If two variables have the same name, it's very likely that they refer to the same concept and, therefore, it would make the lives of code readers easier if they share the exact same name, including casing and all.
Refactoring Proposal
Rename one or more of the variables.
Configuration
The rule must have some soundness_level parameter to adjust how much alike two variables need to be for them to be considered the same.
Consistent Variable Naming
Brief Description
This is a more sophisticated version of #266, but it's also more heuristic (thus the possibility of emitting false positives).
The idea is for Elvis to use some sound-alike algorithm to find variables with similar names, like
MyVar
andMy_Var
, orMyVar
andMyVariable
, orMyID
andMy_id
, etc…Should be on by default?
NO, unless we find a suitable default with a very low false positive rate.
Reasoning
The reasoning here is, again, similar to #266:
Refactoring Proposal
Rename one or more of the variables.
Configuration
The rule must have some
soundness_level
parameter to adjust how much alike two variables need to be for them to be considered the same.Examples
The text was updated successfully, but these errors were encountered: