UnconditionalIfStatement

Do not use "if" statements that are always true or always false.

This rule is defined by the following XPath expression:

 
//IfStatement/Expression
 [count(PrimaryExpression)=1]
 /PrimaryExpression/PrimaryPrefix/Literal/BooleanLiteral

                

Example:

                
  
public class Foo {
 public void close() {
  if (true) {
       // ...
   }
 }
}