com.puppycrawl.tools.checkstyle.checks.coding
public final class ReturnCountCheck extends AbstractFormatCheck
Restricts return statements to a specified count (default = 2).
Ignores specified methods (equals()
by default).
Rationale: Too many return points can be indication that code is attempting to do too much or may be difficult to understand.
Constructor Summary | |
---|---|
ReturnCountCheck() Creates new instance of the checks. |
Method Summary | |
---|---|
void | beginTree(DetailAST aRootAST) {@inheritDoc} |
int[] | getDefaultTokens() {@inheritDoc} |
int | getMax()
Getter for max property. |
int[] | getRequiredTokens() {@inheritDoc} |
void | leaveToken(DetailAST aAST) {@inheritDoc} |
void | setMax(int aMax)
Setter for max property. |
void | visitToken(DetailAST aAST) {@inheritDoc} |
Returns: maximum allowed number of return statements.
Parameters: aMax maximum allowed number of return statements.