org.codenarc.rule.unused
[Groovy] Class UnusedPrivateMethodRule
java.lang.Object
org.codenarc.rule.AbstractRule
org.codenarc.rule.AbstractAstVisitorRule
org.codenarc.rule.unused.UnusedPrivateMethodRule
class UnusedPrivateMethodRule
extends AbstractAstVisitorRule
Rule that checks for private methods that are not referenced within the same class.
Known limitations:
- Does not handle method reference through property access: getName() accessed as x.name
- Does not handle method invocations when method name is a GString (e.g. this."${methodName}"
- Does not handle invoking private method of another instance (i.e. other than 'this')
- Does not differentiate between multiple private methods with the same name but different parameters (i.e., overloaded)
- Does not check constructors
- Authors:
- Chris Mair
- Hamlet D'Arcy
- Version:
- \$Revision: 609 \$ - \$Date: 2011-02-24 13:48:43 -0500 (Thu, 24 Feb 2011) \$
Methods inherited from class AbstractRule
|
applyTo, applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, isReady, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport, toString, validate |
name
String name
-
priority
int priority
-
applyTo
@Override
void applyTo(SourceCode sourceCode, List violations)
-
Groovy Documentation