GLOBAL.DPPF
Declare "public"/"protected" fields as inaccessible as possible
Description
This rule flags any "public"/"protected" field that is more accessible than 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.
|