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™.
CodeScan and VS Code Plugin as of now will not work along with the SonarLint™ installation, so first 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.
To install CodeScan for IntelliJ:
- Navigate to the Settings > Plugins.
- Click on 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 the CodeScan by 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, click on it.
Make sure you select the checkbox which says "Automatically trigger analysis".
- It opens a new popup window, where you have to give the Configuration name and choose the connection type of your preference.
If you're using the CodeScan European instance with the Codescan IntelliJ plugin, select Connect to a server and enter https://app-eu.codescan.io in the CodeScan URL section.
- Click next.
- Now it will take you to another window where you can enter your token.
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.
To Bind the project with CodeScan:
- Go to File > Settings > CodeScan > Project settings.
- Select the checkbox which says Bind the project with CodeScan/CodeScan Cloud.
- Select the Connection under the Project binding 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.
- 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.