Why is this an issue?
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
return ((3)) # Noncompliant
return ((x + 1)) # Noncompliant
x = ((y / 2)) + 1 # Noncompliant
Compliant solution
return 3
return (3)
return x + 1
return (x + 1)
x = y / 2 + 1
x = (y / 2) + 1