5

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.

1

2 Answers 2

1

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.

0

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

2
  • This just shows which code has test code right. You may have code + test code, but never really use that code for anything functional. Commented Dec 18, 2012 at 12:48
  • But then you know that you have a test code that is never used. My example is for subconsciously unused code. Commented Dec 18, 2012 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .