Jtest logo




Contents  Previous  Next  Index

GLOBAL.DPPC


Declare "public"/"protected" classes as inaccessible as possible

Description

This rule flags any "public"/"protected" class that is more accessible than is necessary.

Using Global Static Analysis, Jtest can detect if "public"/"protected" 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 class's accessibility or document the reason for the excessive accessibility.


Contents  Previous  Next  Index

ParaSoft logo
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft