Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Apex Dependency AnalyzerNew to Visual Studio Code? Get it now.
Apex Dependency Analyzer

Apex Dependency Analyzer

mohanc5

|
37 installs
| (0) | Free
Analyze Apex class dependencies in Salesforce and generate a Graphviz diagram
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Apex Dependency Analyzer

A Visual Studio Code extension to analyze Apex class dependencies in a Salesforce org, generate a dependency report in CSV format, and create visual dependency diagrams in DOT, SVG, and PNG formats. The extension stores output files in a temporary directory, opens CSV, DOT, and PNG files in VS Code side editors, and opens the temporary folder in the system file explorer for viewing the SVG in a web browser.

Features

  • Fetch Apex Classes: Queries all Apex classes in a Salesforce org (excluding managed packages).
  • Analyze Dependencies: Retrieves dependencies for each Apex class using the Salesforce Tooling API.
  • Generate Reports:
    • CSV file (apex_class_dependencies.csv) listing classes and their dependencies.
    • DOT file (apex_dependencies.dot) for the dependency graph.
    • SVG file (apex_dependencies.svg) for visual dependency diagrams.
  • Output Handling:
    • Stores files in a unique temporary directory (e.g., /tmp/apex-dependency-analyzer-abc123 on Linux/Mac).
    • Opens CSV, DOT, and PNG files in VS Code side editors.
    • Opens the temporary folder in the system file explorer (e.g., Finder on macOS, File Explorer on Windows) for viewing the SVG in a web browser.
  • User Feedback: Displays progress notifications and logs details in the VS Code Output panel ("Apex Dependency Analyzer").

screenshot

Prerequisites

  • Visual Studio Code: Version 1.85.0 or higher.
  • Salesforce CLI: Installed and configured with an authenticated org alias/username.
    • Install: Salesforce CLI Installation Guide
    • Authenticate an org: sf org auth web login -a <alias>
  • Node.js and npm: Required for development and building the extension.
  • System Utilities:
    • macOS: open command (pre-installed).
    • Windows: start command (pre-installed).
    • Linux: xdg-open (install via sudo apt-get install xdg-utils on Ubuntu).
  • Optional: A VS Code extension like "Image Preview" for viewing PNG files in side editors.

Usage

  1. Open VS Code and ensure a Salesforce org is authenticated via the Salesforce CLI.
  2. Run the Command:
    • Open the Command Palette (Ctrl+Shift+P).
    • Select Apex Dependency Analyzer: Analyze Dependencies.
  3. Enter Salesforce Org Alias/Username:
    • Input the alias or username of the authenticated Salesforce org (e.g., my-org-alias).
  4. View Results:
    • Progress Notifications: The extension shows progress (e.g., "Fetching Apex classes...") in a notification.
    • Output Files:
      • CSV (apex_class_dependencies.csv): Lists Apex classes and their dependencies.
      • DOT (apex_dependencies.dot): Graphviz source for the dependency graph.
      • SVG (apex_dependencies.svg): Visual dependency diagram.
    • File Handling:
      • CSV, DOT files open automatically in VS Code side editors.
      • The temporary folder opens in the system file explorer (e.g., Finder on macOS, File Explorer on Windows).
      • Double-click the SVG file in the folder to view it in your default web browser.
    • Logs: Check the VS Code Output panel ("Apex Dependency Analyzer") for the temporary directory path and detailed logs.

Output Files

  • Location: Files are stored in a unique temporary directory (e.g., /tmp/apex-dependency-analyzer-abc123 on Linux/Mac, %TEMP%\apex-dependency-analyzer-abc123 on Windows).
  • Files:
    • apex_class_dependencies.csv: Comma-separated list of Apex classes and their dependencies.
    • apex_dependencies.dot: Graphviz DOT file for the dependency graph.
    • apex_dependencies.svg: Visual diagram viewable in a web browser.
  • Cleanup: Temporary files persist until the OS cleans them up (e.g., on reboot). Manually delete the temporary directory if needed.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft