linter icon indicating copy to clipboard operation
linter copied to clipboard

Flag possible missing else in consecutive if statements

Open filiph opened this issue 9 years ago • 1 comments

if (getCheckedOrSelected(aFrame, !isCheckbox)) {
  inputState = CHECKED;
} if (isCheckbox && getIndeterminate(aFrame)) {
  inputState = INDETERMINATE;
}

Frankly, I'm not sure how strongly we could believe this hint, but basically when there are two if statements next to each other that can both be true and they both mutate the same variable in different ways, it's strange. A good additional clue would be the missing newline before the second if statement but I'm not sure if analyzer has access to whitespace info.

filiph avatar Feb 16 '16 19:02 filiph

dartfmt might help here.

alexeieleusis avatar Sep 09 '16 05:09 alexeieleusis