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
The version that seems preferred gets close to an unnecessary_nested_if() violation:
if (rare_condition1&&rare_condition2) {
key<-valif (foo(key)) {
bar(key)
}
}
This increases the indentation vs. the original version; this problem gets worse (possibly combinatorially) if there's more than one such assignment in the same if() condition.
IINM this is a subset of #2015, but still could be used in different situations. Again there's no such carveout in the style guide, so this usage should be disallowed by default.
The text was updated successfully, but these errors were encountered:
Related but I'm not sure it's the same as #2015.
Another type of violation to
implicit_assignment_linter()
that I find a bit awkward to refactor looks like:Lazy assignment means it's rare that
key
is actually assigned, so this refactor is wasteful:The version that seems preferred gets close to an
unnecessary_nested_if()
violation:This increases the indentation vs. the original version; this problem gets worse (possibly combinatorially) if there's more than one such assignment in the same
if()
condition.IINM this is a subset of #2015, but still could be used in different situations. Again there's no such carveout in the style guide, so this usage should be disallowed by default.
The text was updated successfully, but these errors were encountered: