org.codenarc.rule.unused
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
- author:
- Chris Mair
- version:
- $Revision: 255 $ - $Date: 2009-12-23 21:46:34 -0500 (Wed, 23 Dec 2009) $
Methods inherited from class AbstractRule
|
applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport |
astVisitorClass
Class astVisitorClass
-
name
String name
-
priority
int priority
-
UnusedPrivateMethodRule
UnusedPrivateMethodRule()
-
Groovy Documentation