Checking your code with Visual Studio Code

Once installed and configured, your Live Check Quality extension lets you check and improve your code with best practices from our rulesets. 

You can check the following types of CEs: Classes, Triggers, Pages, Components, Objects, Reports.

Checking on demand

Every time you wish, you can run a check on the file you are working on.

→ To check your code

  1. Press Ctrl + Shift + P. This opens up a command prompt. 
  2. Type in Salesforce Quality Live Check, and click on it. This runs a check against all our rules. 
  3. Check the issues detected in the Problems section in the editor. 

    For easy access to the Problems section, always show it in the editor. Go to View >  Appearance, and select the Show Panel.

Working on issues

For all the issues found in the check you can consult the following:

  • If you have a Quality Gates set up, issue indicator - New or Baseline, see below in Working with issues from Quality Gates
  • Issue type
  • Issue severity
  • Line and character number 
  • Link to best practice

→ To work on issues

  1. For each of the issue, you can highlight it in the code by clicking on it from the Problems section.
  2. Check issue severity and open up the best practice link included in the description.
  3. Once you have finished fixing the issue, you can save the file or check again that it does not come up by running the check. 

Working with issues from Quality Gates

Error rendering macro 'excerpt-include'

User 'null' does not have permission to view the page.

See more about how to set up OLD Quality Gates.

Once you have set up a Quality Gate on your org, you'll see that the issues reported on a file are divided into two categories: 

  • New - all the new issues added after you have baselined your platform. These issues should be fixed before you commit the file. 
  • Baseline - all the existing issues you have decided to accept as your existing technical debt.

If there are any new issues detected, the Quality Gates is alerting you and your developers that these should be fixed first by displaying the following message: 

Quality Gate does not allow code with any new issues. Make sure you solve these first.

Last modified on Feb 2, 2021