GLOBAL.DPAF
Declare package-private fields as inaccessible as possible
Description
This rule flags any package-private field that is more accessible than is necessary.
Using Global Static Analysis, Jtest can detect if non-"private" fields/methods/classes can be made less accessible.
Making the fields/methods/classes as inaccessible as possible makes the code much more object-oriented and it is much easier to understand code dependencies.
Example
See examples/static/GLOBAL/too-accessible.
Repair
Change the field's accessibility or document the reason for the excessive accessibility.
|