Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JAVASCRIPT-1.2
-
Component/s: JavaScript
-
Labels:None
-
Number of attachments :
Description
- Title
Collapsible If statements
- Description
Several 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.
Example :
if(condition1) { if(condition2){ doSomething(); } }
should be replaced by :
if(condition1 && condition2){
doSomething();
}
- Violation message
Those two 'if' statements can be consolidated.
- Default severity
Minor
Part of Sonar Way quality profile
Issue Links
- is related to
-
SONARPLUGINS-2515
Update the SQALE mapping for new rules
-
Manually tested.