Integrating Codacy with Visual Studio Code#
The Codacy Visual Studio Code extension is an open-source project that enables developers to review directly in VS Code the result of Codacy analysis for the pull requests they’re working on.
Use this extension to get the full list of problems found by Codacy for a pull request and navigate to any Quality issue that you want to review and fix.
To use this extension you need a Codacy account
Installing the Codacy VS Code extension#
Make sure that the repository you’re working on is analyzed by Codacy and that you have at least Repository Read permissions.
If this is your first time using Codacy, see how to add and analyze your first repository.
Alternatively, you can install it manually by downloading the latest release as a VSIX package.
Getting pull request quality and coverage data#
To see Codacy quality and coverage data for the pull request you're working on, follow these steps:
Open the repository directory in VS Code.
If the repository isn't on Codacy yet, add it to Codacy first.
Check out the branch associated with the open pull request you're working on.
Open the main view by clicking the Codacy logo in the activity bar or the Codacy tab in the status bar.
If you’re not signed in, click the Sign in button to authorize VS Code on Codacy.
After completing these steps, the main view shows the result of the latest Codacy analysis for the pull request. The VS Code Problems tab lists the Quality issues found.
The main view displays the information about the code quality changes introduced by the pull request:
The Quality status of the pull request, either up to standards or not up to standards, based on the Quality gates set for the repository.
Any Quality issues introduced or fixed by the pull request. These are the same issues you find in the Quality Issues tabs in the Codacy app and are also visible in VS Code's Problems tab.
The number next to each file name is the total number of Quality issues that the pull request adds to or removes from that file. The number farther to the right is the number of new Medium or Critical Quality issues. If there are any such issues, the file name is also highlighted in yellow (Medium) or red (Critical).
The diff coverage and coverage variation introduced by the pull request. These are the same values you find in the Pull request coverage overview panel in the Codacy app.
The percentage next to each file name is the coverage variation for that file.
Sequences of duplicate code (clones). These are the same ones you find in the Quality Duplication tabs in the Codacy app.
Variations in code complexity.
Reviewing pull request issues#
In the Problems tab, Codacy displays the same Quality issues you find in the main view and lets you navigate to the exact line of code where the issue was found.
Code coverage, duplicates, and complexity aren't currently shown in the Problems tab.
To review Quality issues:
Open the Problems tab (use
Ctrl+Shift+Mon Windows/Linux or
Click the name of the issue you want to review.
Hover over a highlighted issue in the code editor to view available actions and suggested quick fixes (if available).
For a list of tools that support quick fixes, see Supported languages and tools.
Once you've addressed the problems in your code, push your changes to the Git provider so that Codacy analyzes the updated code.
When the analysis is complete, the Codacy extension automatically refreshes the pull request analysis result. You can also refresh the pull request data manually by clicking the Refresh Pull Request button in the main view.
Share your feedback 📢
Did this page help you?
Thanks for the feedback! Is there anything else you'd like to tell us about this page?
255 characters left
We're sorry to hear that. Please let us know what we can improve:
255 characters left
Alternatively, you can create a more detailed issue on our GitHub repository.
Thanks for helping improve the Codacy documentation.
Edit this page on GitHub if you notice something wrong or missing.
If you have a question or need help please contact firstname.lastname@example.org.