Class AbstractComplexityCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.puppycrawl.tools.checkstyle.checks.metrics.AbstractComplexityCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
@Deprecated public abstract class AbstractComplexityCheck extends AbstractCheck
Deprecated.Checkstyle will not support abstract checks anymore. UseAbstractCheck
instead.Base class for checks the calculate complexity based around methods.- Author:
- Simon Harris, Oliver Burn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractComplexityCheck(int max)
Deprecated.Creates an instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected BigInteger
getCurrentValue()
Deprecated.Gets the current value.protected abstract String
getMessageID()
Deprecated.Gets the message ID to log violations with.int[]
getRequiredTokens()
Deprecated.The tokens that this check must be registered for.protected void
incrementCurrentValue(BigInteger amount)
Deprecated.Increments the current value by a specified amount.void
leaveToken(DetailAST ast)
Deprecated.Called after all the child nodes have been process.protected abstract void
leaveTokenHook(DetailAST ast)
Deprecated.Hook called when leaving a token.protected BigInteger
popValue()
Deprecated.Pops a value off the stack and makes it the current value.protected void
pushValue()
Deprecated.Push the current value on the stack.protected void
setCurrentValue(BigInteger value)
Deprecated.Set the current value.void
setMax(int max)
Deprecated.Set the maximum threshold allowed.void
visitToken(DetailAST ast)
Deprecated.Called to process a token.protected abstract void
visitTokenHook(DetailAST ast)
Deprecated.Hook called when visiting a token.-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
-
-
-
-
Constructor Detail
-
AbstractComplexityCheck
protected AbstractComplexityCheck(int max)
Deprecated.Creates an instance.- Parameters:
max
- the threshold of when to report an error
-
-
Method Detail
-
getMessageID
protected abstract String getMessageID()
Deprecated.Gets the message ID to log violations with.- Returns:
- the message ID to log violations with
-
visitTokenHook
protected abstract void visitTokenHook(DetailAST ast)
Deprecated.Hook called when visiting a token. Will not be called the method definition tokens.- Parameters:
ast
- the token being visited
-
leaveTokenHook
protected abstract void leaveTokenHook(DetailAST ast)
Deprecated.Hook called when leaving a token. Will not be called the method definition tokens.- Parameters:
ast
- the token being left
-
getRequiredTokens
public final int[] getRequiredTokens()
Deprecated.Description copied from class:AbstractCheck
The tokens that this check must be registered for.- Specified by:
getRequiredTokens
in classAbstractCheck
- Returns:
- the token set this must be registered for.
- See Also:
TokenTypes
-
setMax
public final void setMax(int max)
Deprecated.Set the maximum threshold allowed.- Parameters:
max
- the maximum threshold
-
visitToken
public void visitToken(DetailAST ast)
Deprecated.Description copied from class:AbstractCheck
Called to process a token.- Overrides:
visitToken
in classAbstractCheck
- Parameters:
ast
- the token to process
-
leaveToken
public void leaveToken(DetailAST ast)
Deprecated.Description copied from class:AbstractCheck
Called after all the child nodes have been process.- Overrides:
leaveToken
in classAbstractCheck
- Parameters:
ast
- the token leaving
-
getCurrentValue
protected final BigInteger getCurrentValue()
Deprecated.Gets the current value.- Returns:
- the current value
-
setCurrentValue
protected final void setCurrentValue(BigInteger value)
Deprecated.Set the current value.- Parameters:
value
- the new value
-
incrementCurrentValue
protected final void incrementCurrentValue(BigInteger amount)
Deprecated.Increments the current value by a specified amount.- Parameters:
amount
- the amount to increment by
-
pushValue
protected final void pushValue()
Deprecated.Push the current value on the stack.
-
popValue
protected final BigInteger popValue()
Deprecated.Pops a value off the stack and makes it the current value.- Returns:
- pop a value off the stack and make it the current value
-
-