newrules

These are new rules for the next release

UnconditionalIfStatement

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

This rule is defined by the following XPath expression:


                    
//IfStatement/Expression/ConditionalAndExpression
 /InstanceOfExpression/UnaryExpression
 /PrimaryExpression/PrimaryPrefix/Literal/BooleanLiteral
                    
                

Here's an example of code that would trigger this rule:

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