Removing redundant code

I am noticing there is a lot of redundant code in the Apex project I am working on.
Is there any special way / tool or whatever to figure out what code never gets called in your code base?

Thanks.

Answer

At present there are no refactoring tools as such, though depending on how confident you are about the functional coverage of your Apex tests. You can utilise the code coverage as measure for this, you can also view in a colour coded way, code covered and that not.

Do make sure if your building a managed package, that before you release you scan at least for classes that are marked as ‘global’ as these can only be cleaned out and not removed once released.

Attribution
Source : Link , Question Author : dublintech , Answer Author : Andrew Fawcett

Leave a Comment