Dominic Bütow
Dominic Bütow

Reputation: 183

javascript:S2583 false positive

I think I found a false positive:

const items = document.querySelectorAll(selectors);
for (const item of items) {
  if(item) { //Change this condition so that it does not always evaluate to "false".
    ....
  }
}

Change this condition so that it does not always evaluate to "false".

I do not understand why it creates this ticket. I could understand if it would say that it alway evaluate to "true" as document.querySelectorAll should not return null results.

Any ideas?

We are using the 2.13 version of the javascript plugin.

Upvotes: 1

Views: 247

Answers (1)

Pierre-Yves
Pierre-Yves

Reputation: 1546

Version 2.14 does not raise an issue on this kind of code.

Upvotes: 1

Related Questions