Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Apex Code Coverage VisualizerNew to Visual Studio Code? Get it now.

Apex Code Coverage Visualizer

ModicaTech

|
2,561 installs
| (10) | Free
Shows Apex code coverage summary
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Salesforce APEX Code Coverage Visualizer for Visual Studio Code

Introduction

This extension shows a summary of the code coverage for all APEX classes in the current project. The extension relies on the official Salesforce Extensions test runner which creates the necessary files used to show the code coverage.

Apex Code Coverage

It works with both Dark and Light themes

Apex Code Coverage

Documentation

Make sure you have configured the preferences on the Salesforce extension to retrieve code coverage on test execution. To do this, go to Visual Studio Code menu File->Preferences->Settings and enter "coverage" in the search box, and then from the search results enable the Retrieve-test-code-coverage setting:

Test Settings

After that, just execute some tests as you normally would from the Test view:

Test Execution

Once the test coverage has been downloaded by the Salesforce CLI, you can now see the code coverage for a specific Apex file in the status bar, and also the overall code coverage in a new window:

Coverage in Status Bar

Coverage in Status Bar

The indicator in the status bar will only appear if the Apex class has tests coverage downloaded for such class. You can see three indicators, depending on the coverage percentage:

Coverage Indicator
0% - 65% Coverage Poor
65% - 75% Coverage Low
75% - 100% Coverage Low

Coverage Window

Coverage in Status Bar

You can get to this window by either clicking on the coverage indicator on the status bar, or by executing the SFDX: Show Code Coverage from the command palette:

SFDX: Show Code Coverage

Filtering

It is possible to filter down the test results to show only tests that are below the required 75% coverage, to allow the developer to focus on those tests that require inmediate action. Also, it is posible to filter further down on the name of the apex file:

Filter

Bugs and Feedback

To report issues with Salesforce Extensions for VS Code, open a bug on GitHub. If you would like to suggest a feature, create a feature request on GitHub.

License

This project is licensed under the terms of the MIT license.

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2019 Microsoft