public class CyclomaticComplexityCheck extends AbstractCheck
Check has following properties:
switchBlockAsSingleDecisionPoint - controls whether to treat the whole switch block as a single decision point. Default value is false
| Modifier and Type | Field and Description |
|---|---|
static String |
MSG_KEY
A key is pointing to the warning message text in "messages.properties"
file.
|
| Constructor and Description |
|---|
CyclomaticComplexityCheck() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
protected void |
incrementCurrentValue(BigInteger amount)
Increments the current value by a specified amount.
|
void |
leaveToken(DetailAST ast)
Called after all the child nodes have been process.
|
protected BigInteger |
popValue()
Pops a value off the stack and makes it the current value.
|
protected void |
pushValue()
Push the current value on the stack.
|
void |
setMax(int max)
Set the maximum threshold allowed.
|
void |
setSwitchBlockAsSingleDecisionPoint(boolean switchBlockAsSingleDecisionPoint)
Sets whether to treat the whole switch block as a single decision point.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
protected void |
visitTokenHook(DetailAST ast)
Hook called when visiting a token.
|
beginTree, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic static final String MSG_KEY
public CyclomaticComplexityCheck()
public void setSwitchBlockAsSingleDecisionPoint(boolean switchBlockAsSingleDecisionPoint)
switchBlockAsSingleDecisionPoint - whether to treat the whole switch
block as a single decision point.public final void setMax(int max)
max - the maximum thresholdpublic int[] getDefaultTokens()
AbstractCheckgetDefaultTokens in class AbstractCheckTokenTypespublic int[] getAcceptableTokens()
AbstractCheckgetAcceptableTokens in class AbstractCheckTokenTypespublic final int[] getRequiredTokens()
AbstractCheckgetRequiredTokens in class AbstractCheckTokenTypespublic void visitToken(DetailAST ast)
AbstractCheckvisitToken in class AbstractCheckast - the token to processpublic void leaveToken(DetailAST ast)
AbstractCheckleaveToken in class AbstractCheckast - the token leavingprotected final void visitTokenHook(DetailAST ast)
ast - the token being visitedprotected final void incrementCurrentValue(BigInteger amount)
amount - the amount to increment byprotected final void pushValue()
protected final BigInteger popValue()
Copyright © 2001-2017. All Rights Reserved.