When working with large Salesforce projects containing many Apex classes, Visualforce pages, components, and triggers, it is useful to identify unused methods and variables to maintain clean, efficient, and maintainable code.
This article explains how to use the Salesforce Tooling API's SymbolTable object to identify Apex methods that are defined in a class but not referenced by any other Apex class.
How to Use Tooling API SymbolTable
The Salesforce Tooling API can be used to retrieve the SymbolTable for each Apex class in your org. The SymbolTable contains:
By scanning the methods defined in each Apex class's SymbolTable and comparing them against the externalReferences found across all other classes, you can identify methods that are defined but never called by any other Apex class — indicating they are potentially unused.
Third-Party Canvas App Option
A community-built canvas app is already available to automate this SymbolTable analysis. Note: This is a third-party, community-developed tool and is not supported by Salesforce. See Spring Cleaning Apex Code with the Tooling API for details.
Important Limitation
This approach only scans Apex classes. It will not detect declarative references to methods from Visualforce markup.
000387972

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.