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) |
| int[] | getDefaultTokens() |
| int | getMax()
Getter for max property. |
| int[] | getRequiredTokens() |
| void | leaveToken(DetailAST aAST) |
| void | setMax(int aMax)
Setter for max property. |
| void | visitToken(DetailAST aAST) |
Returns: maximum allowed number of return statements.
Parameters: aMax maximum allowed number of return statements.