V3088. The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present.


The analyzer detected an expression enclosed in double parentheses. It is very likely that one of the parentheses is misplaced.

Note that the analyzer does not simply look for code fragments with double parentheses; it looks for those cases when placing one of them differently can change the meaning of the whole expression. Consider the following example:

if((!isLowLevel|| isTopLevel))

This code looks suspicious: there is no apparent reason for using additional parentheses here. Perhaps the expression was actually meant to look like this:

if(!(isLowLevel||isTopLevel))

Even if the code is correct, it is better to remove the extra pair of parentheses. There are two reasons:

  • Those programmers who will be reading the code may be confused by the double parentheses and doubt its correctness.
  • Removing the extra parentheses will make the analyzer stop reporting the false positive.

Bugs Found

Checked Projects
344
Collected Errors
12 899