The CodeScan VS Code plugin provides on-the-fly feedback to developers on bugs and quality issues, it is a fully-integrated user experience in VS Code.
Prerequisites
You will need:
- Java 8
- A working SonarQube (6.7.4+) installation
- A recent version of VS Code installed (v1.12 or above)
- A licensed version of CodeScan (4.0.7+) plugin to get started (see here)
- If you are working with Salesforce code, you will need the Salesforce Extensions for VS Code or at least the Apex and Visualforce plugins.
Installation
-
In VS Code, go to the Marketplace and download CodeScan.
-
Restart VS Code.
-
In the VS Code User Settings, in the CodeScan section, copy over the
codescan.servers
andcodescan.project
settings to the right hand pane. -
Edit the following in
codescan.servers
. -
For CodeScan Cloud
Add organizationKey
as your CodeScan Cloud organization key (Where do I find this?).- Add
token
with a token generated in here in CodeScan Cloud. - Add server
Url
ashttps://app.codescan.io/
- Add server
Id
with a value you will remember.
-
For Self-Hosted CodeScan
- Add
token
with a token generated in SonarQube. - Add server
Url
as your SonarQube server URL (Default is http://localhost:9000). - Add server
Id
with a value you will remember.
- Add
- Edit the following in
codescan.project
- Add
projectKey
with the key of the project you would like to use the settings from (Where do I find this?). - Add
serverId
with theserverId
you used when editing yourcodescan.servers
settings.
- Add
- Now hit Ctrl+Shift+P (Windows/Linux) or Shift+Command+P(Mac) to open the Command Palette.
- Type in CodeScan to bring up the CodeScan commands and run “Update CodeScan binding to SonarQube/CodeScan Cloud”. If any changes are made on the SonarQube server you should repeat this step.
- Open a file, you should see the issues in your code underlined.
Troubleshooting
Some useful debugging information is available under the Output window under the ‘CodeScan’ tab.
CodeScan should automatically find the JRE installed on your computer. If you are having trouble you can specify the path using sonarlint.ls.javaHome
variable in your VS Code Settings.
You can check for any serious errors by going to Help > Toggle Developer Tools to bring up the console.
You can also contact us at the CodeScan Support Page. Feel free to ask questions, report issues, and give suggestions.
Comments
0 comments
Please sign in to leave a comment.