com.puppycrawl.tools.checkstyle.checks.coding
Class SimplifyBooleanExpressionCheck
- Configurable, Contextualizable
public class SimplifyBooleanExpressionCheck
Checks for overly complicated boolean expressions. Currently finds code like
if (b == true)
,
b || true
,
!false
,
etc.
Rationale: Complex boolean logic makes code hard to understand and maintain.
An example of how to configure the check is:
<module name="SimplifyBooleanExpression"/>
- lkuehne
beginTree , destroy , finishTree , getAcceptableTokens , getClassLoader , getDefaultTokens , getFileContents , getLines , getRequiredTokens , getTabWidth , getTokenNames , init , leaveToken , log , log , setClassLoader , setFileContents , setMessages , setTabWidth , setTokens , visitToken |
getMessageBundle , getSeverity , getSeverityLevel , log , log , log , log , log , log , log , log , log , log , log , setSeverity |
getAcceptableTokens
public int[] getAcceptableTokens()
Prevent user from changing tokens in the configuration.
- getAcceptableTokens in interface Check
Check
getDefaultTokens
public int[] getDefaultTokens()
- getDefaultTokens in interface Check
Check
getRequiredTokens
public int[] getRequiredTokens()
- getRequiredTokens in interface Check
Check