Find your content:

Search form

You are here

Removing redundant code

 
Share

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.


Attribution to: dublintech

Possible Suggestion/Solution #1

Yeah, it calls apex test class. After running a test class you can check the code coverage and see what code is really in use.

enter image description here


Attribution to: Sergej Utko

Possible Suggestion/Solution #2

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 to: Andrew Fawcett
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/5542

My Block Status

My Block Content