public class CyclomaticComplexityCheck extends AbstractComplexityCheck
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()
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
protected String |
getMessageID()
Gets the message ID to log violations with.
|
protected void |
leaveTokenHook(DetailAST ast)
Hook called when leaving a token.
|
void |
setSwitchBlockAsSingleDecisionPoint(boolean switchBlockAsSingleDecisionPoint)
Sets whether to treat the whole switch block as a single decision point.
|
protected void |
visitTokenHook(DetailAST ast)
Hook called when visiting a token.
|
getCurrentValue, getRequiredTokens, incrementCurrentValue, leaveToken, popValue, pushValue, setCurrentValue, setMax, visitToken
beginTree, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public static final String MSG_KEY
public void setSwitchBlockAsSingleDecisionPoint(boolean switchBlockAsSingleDecisionPoint)
switchBlockAsSingleDecisionPoint
- whether to treat the whole switch
block as a single decision point.public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
public int[] getAcceptableTokens()
Check
getAcceptableTokens
in class Check
TokenTypes
protected final void visitTokenHook(DetailAST ast)
AbstractComplexityCheck
visitTokenHook
in class AbstractComplexityCheck
ast
- the token being visitedprotected final String getMessageID()
AbstractComplexityCheck
getMessageID
in class AbstractComplexityCheck
protected void leaveTokenHook(DetailAST ast)
AbstractComplexityCheck
leaveTokenHook
in class AbstractComplexityCheck
ast
- the token being leftCopyright © 2001–2015. All rights reserved.