All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.S1110.html Maven / Gradle / Ivy

There is a newer version: 10.17.0.28100
Show newest version

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.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy