Class ClassFanOutComplexityCheck
- 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.AbstractClassCouplingCheck
-
- com.puppycrawl.tools.checkstyle.checks.metrics.ClassFanOutComplexityCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
public final class ClassFanOutComplexityCheck extends AbstractClassCouplingCheck
The number of other classes a given class relies on. Also the square of this has been shown to indicate the amount of maintenance required in functional programs (on a file basis) at least.- Author:
- Simon Harris, o_sukhodolsky
-
-
Constructor Summary
Constructors Constructor Description ClassFanOutComplexityCheck()
Creates new instance of this check.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
getAcceptableTokens()
The configurable token set.protected String
getLogMessageId()
Returns message key we use for log violations.int[]
getRequiredTokens()
The tokens that this check must be registered for.-
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.metrics.AbstractClassCouplingCheck
beginTree, getDefaultTokens, getMax, leaveToken, setExcludeClassesRegexps, setExcludedClasses, setExcludedPackages, setMax, visitToken
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
destroy, finishTree, getClassLoader, 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
-
-
-
-
Field Detail
-
MSG_KEY
public static final String MSG_KEY
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClassFanOutComplexityCheck
public ClassFanOutComplexityCheck()
Creates new instance of this check.
-
-
Method Detail
-
getRequiredTokens
public int[] getRequiredTokens()
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
-
getAcceptableTokens
public int[] getAcceptableTokens()
Description copied from class:AbstractCheck
The configurable token set. Used to protect Checks against malicious users who specify an unacceptable token set in the configuration file. The default implementation returns the check's default tokens.- Specified by:
getAcceptableTokens
in classAbstractCheck
- Returns:
- the token set this check is designed for.
- See Also:
TokenTypes
-
getLogMessageId
protected String getLogMessageId()
Description copied from class:AbstractClassCouplingCheck
Returns message key we use for log violations.- Specified by:
getLogMessageId
in classAbstractClassCouplingCheck
- Returns:
- message key we use for log violations.
-
-