Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JAVASCRIPT-1.0
-
Fix Version/s: JAVASCRIPT-1.1
-
Component/s: JavaScript
-
Labels:None
-
Number of attachments :
Description
I have noticed that I am getting a false positive with this rule. I will tell me that I have 4 levels of IF statements. This is wrong because I only have two.
This is how it seems to work it out
if(true) { ->+1 } else if(true) { ->+1 if(true){ ->+1 (This is where it will say is at level 4) } else if(true) { ->+1 } }
What I think is happening is that it seems to be adding an extra "if" if its an "else if" which it shouldn't be.
According to "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/if...else" "else if" is just a "nested if"