I used to be incredibly bad at limiting access of my variables/methods/classes
, I tended to use public a hell of a lot when I shouldn't.
I was just wondering if there was any tool - plugin, external or otherwise - that can search your source code, find what calls your variables/methods/classes
and changes the visibility if it's too high.
So for example, if I had a public variable and nothing outside that class called it, then the tool would reduce its access to private.
Mainly I need this for some of my older projects that have to many public variables. It would take far to long for me to sift through all of them and would be extremely annoying/inefficient to leave them public, when I come back to these projects to work on them again.
Take a look at the UCDetector: Unnecessary Code Detector Eclipse plugin. It will create markers for the following problems (which appear in the Eclipse problem view):
It also has support for Eclipse QuickFixes to automatically adjust member visibility
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With