GLOBAL.UPAC
Avoid globally unused package-private classes
Description
This rule flags any globally unused package-private class.
Using Global Static Analysis, Jtest can detect if non-"private" fields/methods/classes are not used by any class.
These unused entities usually point to either:
- Old code that is no longer needed and which makes the class more difficult to understand.
- A logical flaw if the entity needs to be used, but other classes incorrectly avoid using it.
Example
See examples/static/GLOBAL/unused.
Repair
Remove the unused field/method/class or document the reason for its existence.
|