-
Notifications
You must be signed in to change notification settings - Fork 26
SonarLint for Eclipse
According to the web page:
SonarLint is an Eclipse plugin that provides on-the-fly feedback to developers on new bugs and quality issues injected into Java, JavaScript and PHP code.
OpenEdge code can't be checked in SonarLint for Eclipse without a SonarQube server. Please refer to the Getting started page in order to set up a SonarQube server.
In order to install (or upgrade) SonarLint with Progress Developer Studio, please download the right version:
- For Developer Studio 11.7: Version 6.2.2258
- For Developer Studio 12.2: Version 10.11.3905
- For Developer Studio 12.8: Version 10.11.3905
🚯 Please don't report issues to the public mailing lists of SonarLint, as this is not a supported configuration.
From Progress Developer Studio:
- choose
Help
->Install new software...
- click on
Add...
, then on theArchive...
button and select the ZIP file you just downloaded - check the two boxes
SonarLint for Eclipse
andRequired dependencies
- click on
Next >
and follow the instructions - restart Progress Developer Studio
Open the SonarLint Bindings
view, then configure your server connection:
Make sure your project is available on SonarQube (analyzed at least once). Right-click on your project, and select SonarLint
-> Bind to SonarQube or SonarCloud
, then attach your OpenEdge project to a SonarQube project using the SonarQube project key.
- First verify that all databases have a unique identifier. This can be found by executing
FIND FIRST _db. MESSAGE _db-guid.
while connected to each database. Any duplicates in the list of GUIDs will probably lead to an inconsistent database schema in SonarLint. - If using TCP/IP database connections, the schema may not be available immediately from Developer Studio. You can use
OpenEdge -> Refresh cache
in Developer Studio to refresh the schema. - You can also delete the
.schema
files in<project_root>/.sonarlint
to force a refresh during the next analysis
If workspace option Build automatically
(from Project
menu) is unset, and Compile on save if required
(from Preferences -> Progress OpenEdge -> Editor -> Build
) is set, then SonarLint and the compiler are triggered at the same time, and then XML files can't be parsed correctly as they may not be fully generated. In this case, disable Run SonarLint automatically
from SonarLint, and trigger analysis manually.
In case you don't see any issue reported in your source code, then you should enable 'Analysis log' and 'Verbose output' in the SonarLint Console (from Console view).
SonarLint annotations can be configured in the Eclipse preferences, section General > Editors > Text editors > Annotations
Starting from PDSOE 12.7, the SonarLint Rule Description view can't be displayed, and throws an exception in the SonarLint Console:
Unable to open external browser
java.net.MalformedURLException: unknown protocol: data
at java.base/java.net.URL.<init>(URL.java:681)
at java.base/java.net.URL.<init>(URL.java:569)
at java.base/java.net.URL.<init>(URL.java:516)
...
PDSOE defines Edge as the default browser in Eclipse, which has known limitations when it's embedded as a view. Edge is only used to display the Progress welcome page. Reverting to the default browser will solve the problem. This can be done by removing the following line in %DLC%\oeide\eclipse\eclipse.ini
:
-Dorg.eclipse.swt.browser.DefaultType="edge"
As PDSOE 11.7 is based on Eclipse 4.5 (released in 2015) and Java 8, there is an incompatibility between SonarLint and Eclipse secure storage. If you have an error message when trying to connect to the remote SonarQube server, then you should delete the existing secure storage:
- Open Eclipse preferences
- Section General > Security > Secure Storage, then Contents tab
- Select existing "Default Secure Storage" and click on Delete
While not recommended, you can use the latest version of SonarLint (6.2.2244) to connect to SonarQube 10.x from PDSOE 11.7. This has been tested up to 10.3 ; ugly workarounds had to be found to keep PDSOE compatible with SonarLint, and higher version of SonarQube will probably break additional things.
© Riverside Software 2013-2024