The CodeScan IntelliJ plugin provides on-the-fly feedback to developers on bugs and quality issues, it is a fully-integrated user experience in the IntelliJ IDE.
The plugin is derived from SonarLint™ but please NOTE that currently the CodeScan IntelliJ Plugin WILL NOT WORK ALONG SIDE THE SONAR LINT INSTALLATION - you must uninstall SonarLint™.
You will need:
- For SELF HOSTED: a working SonarQube™ (7.9+) installation and licensed CodeScan (4.4+) plugin to get started (see here)
- For CLOUD: A CodeScan Cloud organization with a valid license or trial.
Install CodeScan for IntelliJ
- Navigate to the Settings > Plugins
- Click the Marketplace tab at the top of the settings window,
- Search CodeScan and install the plugin
- Restart IntelliJ for the changes to take effect
Setup Connected Mode
Set up Configuration with CodeScan following the steps below if you need to set up a new one.
- Go to Settings (Preferences on Mac)
- Select or double click on Tools and choose CodeScan in the dropdown.
- You will see another “Settings” tab under which you can see the “+” icon as in the image below, click on it.
Note : Make sure you select the checkbox which says “Automatically trigger analysis”
- It opens a new popup window as in the image below, where you have to give the “Configuration name” and choose the connection type of your preference.
- Click next.
- Now it will take you to another window where you can enter your token as in the image below.
Note: If you are a CodeScan Cloud user, clicking on create token takes you directly to CodeScan Cloud window where you can generate the token.
- Click next after you enter the token.
- A new window shows up where you can choose the organization(If you are part of multiple organizations) which you want to configure.
- Once you choose the Organization, click on Next and then Finish.
Binding the project with CodeScan:
- Now go to File > Settings > CodeScan > Project settings
- Select the checkbox which says Bind the project with CodeScan/CodeScan Cloud as in the image below.
- Under Project binding, select the Connection that you have just setup or choose from the existing one and the Project you want to bind and analyze.
- Click on apply, for the changes to be applied.
Now You will be able to see the errors under the CodeScan window at the bottom in the IDE if there are any, automatically, for the file which is open.
If the errors don't show up immediately, reopen the file and you will be able to see the changes as in the image below.