com.puppycrawl.tools.checkstyle.checks.metrics
Class AbstractComplexityCheck
- Configurable, Contextualizable
public abstract class AbstractComplexityCheck
Base class for checks the calculate complexity based around methods.
beginTree , destroy , finishTree , getAcceptableTokens , getClassLoader , getDefaultTokens , getFileContents , getLines , getRequiredTokens , getTabWidth , getTokenNames , init , leaveToken , log , log , setClassLoader , setFileContents , setMessages , setTabWidth , setTokens , visitToken |
getId , getMessageBundle , getSeverity , getSeverityLevel , log , log , log , log , log , log , log , log , log , log , log , setId , setSeverity |
AbstractComplexityCheck
public AbstractComplexityCheck(int aMax)
Creates an instance.
aMax
- the threshold of when to report an error
getCurrentValue
protected final BigInteger getCurrentValue()
getMax
public final int getMax()
- the maximum threshold allowed
getMessageID
protected abstract String getMessageID()
- the message ID to log violations with
incrementCurrentValue
protected final void incrementCurrentValue(BigInteger aBy)
Increments the current value by a specified amount.
aBy
- the amount to increment by
leaveTokenHook
protected void leaveTokenHook(DetailAST aAST)
Hook called when leaving a token. Will not be called the method
definition tokens.
aAST
- the token being left
popValue
protected final BigInteger popValue()
- pop a value off the stack and make it the current value
pushValue
protected final void pushValue()
Push the current value on the stack
setCurrentValue
protected final void setCurrentValue(BigInteger aValue)
Set the current value
setMax
public final void setMax(int aMax)
Set the maximum threshold allowed.
aMax
- the maximum threshold
visitTokenHook
protected void visitTokenHook(DetailAST aAST)
Hook called when visiting a token. Will not be called the method
definition tokens.
aAST
- the token being visited