org.sonar.l10n.javascript.rules.javascript.S1110.html Maven / Gradle / Ivy
The use of parentheses, even those not required to enforce a desired order of operations, can clarify the intent behind a piece of code. But
redundant pairs of parentheses could be misleading, and should be removed.
Noncompliant Code Example
let x = (y / 2 + 1); //Compliant even if those parenthesis are useless for the compiler
if (a && ((x+y > 0))) { // Noncompliant
//...
}
return ((x + 1)); // Noncompliant
Compliant Solution
let x = (y / 2 + 1);
if (a && (x+y > 0)) {
//...
}
return (x + 1);
Deprecated
This rule is deprecated, and will eventually be removed.