[SalesForce] Tools for refactoring Salesforce Apex code

Are there any tools available which help with Apex code refactoring?

With features like:

  • Renaming classes and updating all references
  • Renaming method names and updating all references
  • Finding usages of class/method
  • Finding redundant code
  • Change Signature
  • Convert Interface to Abstract Class
  • Convert Abstract Class to Interface
  • Extract Superclass
  • Transform Parameters
  • Replace Constructor with Factory Method
  • Convert Method to Property
  • etc

Something like ReSharper would be perfect 🙂


Note: I realise a similar question has been asked before, but that was 3 years ago, so hoping for a positive answer this time.

Best Answer

I know of two choices:

  1. Illuminated Cloud plugin for IntelliJ
  2. Welkin Suite based on Visual Studio

Both will meet most of your requirements.

But I believe IntelliJ + Illuminated Cloud is a better fit.

Both are licensed and pricy.

IntelliJ

  • Renaming classes and updating all references +
  • Renaming method names and updating all references +
  • Finding usages of class/method +
  • Finding redundant code +/- (If I remember well it highlights parts of the code which can be refactored to methods)
  • Change Signature +
  • Convert Interface to Abstract Class +/- (Hmm didn't try that but I think it can be done fairly well with IntelliJ refactoring capabilities
  • Convert Abstract Class to Interface +/-
  • Extract Superclass +
  • Transform Parameters + (Extracting fields you mean?)
  • Replace Constructor with Factory Method +
  • Convert Method to Property +
Related Topic