[RFF] SonarLint for Eclipse 3.2

116 views
Skip to first unread message

Julien HENRY

unread,
Jun 20, 2017, 6:20:44 AM6/20/17
to SonarLint
Hi guys,

I'm about to release a new version of SonarLint for Eclipse. I'm requesting some feedback before doing the final release.

Main changes are:
  - updated Java, JavaScript and Python
  - revamped wizard to configure SonarQube / SonarCloud connection
  - lots of performance improvements, especially on Eclipse startup
  - many other fixes

Images intégrées 1

Full release notes:


You can test using this update site:

Feedback is welcome until Friday.

Thanks,

Julien Henry | SonarSource

Developer

http://sonarsource.com

Olivier Gaudin

unread,
Jun 20, 2017, 7:31:30 AM6/20/17
to Julien HENRY, SonarLint, mark...@sonarsource.com

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/CAD9wyxF8d-f%3DDuXDNh9SVnq%2BDrOm-cvNMvgO0Y1_LN2ZV8pU%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
Olivier Gaudin | SonarSource
CEO & Co-Founder






gilbert...@googlemail.com

unread,
Jun 20, 2017, 10:45:16 AM6/20/17
to SonarLint
Hi Julien,

the possibility to 'Analyze all files' (https://jira.sonarsource.com/browse/SLE-186) is one of the most asked features by our developers.
Tested with RC1, using 'Analyze' in the context menu of a binded projects does nothing - no entry in the Sonarlint console !?
Shouldn't that start a scan of all project files, respecting the exclusions on Sonarqube Server ?

Regards, Gilbert

Am Dienstag, 20. Juni 2017 12:20:44 UTC+2 schrieb Julien HENRY:
Hi guys,

I'm about to release a new version of SonarLint for Eclipse. I'm requesting some feedback before doing the final release.

Main changes are:
  - updated Java, JavaScript and Python
  - revamped wizard to configure SonarQube / SonarCloud connection
  - lots of performance improvements, especially on Eclipse startup
  - many other fixes

Julien HENRY

unread,
Jun 21, 2017, 3:32:35 AM6/21/17
to gilbert...@googlemail.com, SonarLint
Hi Gilbert,

Indeed, I forget to list the "analyze all files" feature, thanks for pointing this.

Tested with RC1, using 'Analyze' in the context menu of a binded projects does nothing - no entry in the Sonarlint console !?

That's weird.. Do you at least see the confirmation popup?
Images intégrées 1

If you don't, it probably means we are unable to enumerate files in the project. I can reproduce by trying to run analysis on a working set that contains only closed projects. Is there anything special with your project?

I could maybe show an error dialog when no files are found, so that user doesn't stay uncertain about why nothing occurs.
 
Shouldn't that start a scan of all project files, respecting the exclusions on Sonarqube Server ?

Yep, that's the purpose :)
 

Julien Henry | SonarSource

Developer

http://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/ccb558a5-830a-496d-a7cd-d1eb92d2badc%40googlegroups.com.

Alix Lourme

unread,
Jun 21, 2017, 5:32:41 AM6/21/17
to SonarLint, gilbert...@googlemail.com
Hello,

Quick re-test on 3.2.0.201706200816 (after first try on 3.2.0.201706121007):
- SLE-187 : LGTM
- SLE-186 : I like !! (exclusions from SonarQube project config not tested). Perhaps allowing a sortable column by priority issue could be useful ...

++
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

gilbert...@googlemail.com

unread,
Jun 21, 2017, 5:38:29 AM6/21/17
to SonarLint, gilbert...@googlemail.com
Hi Julien,


Am Mittwoch, 21. Juni 2017 09:32:35 UTC+2 schrieb Julien HENRY:
Hi Gilbert,

Indeed, I forget to list the "analyze all files" feature, thanks for pointing this.

Tested with RC1, using 'Analyze' in the context menu of a binded projects does nothing - no entry in the Sonarlint console !?

That's weird.. Do you at least see the confirmation popup?
Images intégrées 1

Expected to see that dialog according to https://jira.sonarsource.com/browse/MMF-640 , but no, i don't see neither
a dialog nor something in the SLE console.

 

If you don't, it probably means we are unable to enumerate files in the project. I can reproduce by trying to run analysis on a working set that contains only closed projects. Is there anything special with your project?


It's a dead simple test project with only Java sources - so nothing special.
But i forgot to mention my environment = Eclipse 4.5.0 / 64bit , Java 1.8.0_121, Windows 7 Enterprise


I could maybe show an error dialog when no files are found, so that user doesn't stay uncertain about why nothing occurs.

That would be helpful.

Regards, Gilbert
 

gilbert...@googlemail.com

unread,
Jun 21, 2017, 5:45:52 AM6/21/17
to SonarLint, gilbert...@googlemail.com
P.S. :

i've tried with several binded projects, but it's all the same, no dialog, no sle console entries.
Do i have to edit the eclipse.ini to make it work ??

Regards, Gilbert

Julien HENRY

unread,
Jun 21, 2017, 8:34:02 AM6/21/17
to gilbert...@googlemail.com, SonarLint

2017-06-21 11:45 GMT+02:00 gilbert.rebhan via SonarLint <sona...@googlegroups.com>:
i've tried with several binded projects, but it's all the same, no dialog, no sle console entries.
Do i have to edit the eclipse.ini to make it work ??

Why would you have to edit eclipse.ini?

I just tried with Eclipse Mars and it works fine. Can you try with a fresh new Java project (not binded). Can you also have a look at Eclipse logs.

++

gilbert...@googlemail.com

unread,
Jun 21, 2017, 8:42:52 AM6/21/17
to SonarLint, gilbert...@googlemail.com
Hi Julien,

indeed there's a´n unhandled event loop exception :

!ENTRY org.eclipse.ui 4 0 2017-06-21 14:32:13.776
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoSuchMethodError: org.eclipse.jface.dialogs.MessageDialog.<init>(Lorg/eclipse/swt/widgets/Shell;Ljava/lang/String;Lorg/eclipse/swt/graphics/Image;Ljava/lang/String;II[Ljava/lang/String;)V
 at org.sonarlint.eclipse.ui.internal.command.AnalyzeCommand.askConfirmation(AnalyzeCommand.java:98)
 at org.sonarlint.eclipse.ui.internal.command.AnalyzeCommand.runAnalysisJob(AnalyzeCommand.java:79)
 at org.sonarlint.eclipse.ui.internal.command.AnalyzeCommand.execute(AnalyzeCommand.java:69)
 at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
 at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
 at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
 at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
 at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
 at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
 at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
 at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
 at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
 at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:799)
 at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:675)
 at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:659)
 at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:592)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
 at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
 at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
 at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
 at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
 at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
 at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
 at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
 at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
 at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
 at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
 at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
 at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
 at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

I'll try with  a fresh project later and keep you posted.

Regards, Gilbert

Julien HENRY

unread,
Jun 21, 2017, 9:26:05 AM6/21/17
to gilbert...@googlemail.com, SonarLint
My bad, I only tested with a project having a single file. In this case there is no confirmation dialog. Seems I'm using a method that was not supported on Mars to create the dialog. I'll fix that.

Ticket reopened:

Julien Henry | SonarSource

Developer

http://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.

gilbert...@googlemail.com

unread,
Jun 22, 2017, 2:21:19 AM6/22/17
to SonarLint, gilbert...@googlemail.com
Hi Julien,

"Analyze all" works on project level now with Eclipse Mars, but i'm missing the Sonarlint / Analyze context menu when a package is selected, whereas the context menu
is available when multiple files are selected via <Ctrl>.

Regards, Gilbert
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

Julien HENRY

unread,
Jun 22, 2017, 2:59:13 AM6/22/17
to gilbert...@googlemail.com, SonarLint
2017-06-22 8:21 GMT+02:00 gilbert.rebhan via SonarLint <sona...@googlegroups.com>:
"Analyze all" works on project level now with Eclipse Mars,

Thanks for the test!
 
but i'm missing the Sonarlint / Analyze context menu when a package is selected, whereas the context menu
is available when multiple files are selected via <Ctrl>.

That's a known limitation. I don't think it is a big loss, but we'll see based on feedback in the coming weeks.

++

gilbert...@googlemail.com

unread,
Jun 22, 2017, 3:22:34 AM6/22/17
to SonarLint, gilbert...@googlemail.com
Hm, so if i want to scan all files from specific package(s) only, i'll have to expand the package(s) and select the files manually.
That's not very convenient.

//Gilbert

Julien HENRY

unread,
Jun 22, 2017, 4:39:48 AM6/22/17
to gilbert...@googlemail.com, SonarLint

2017-06-22 9:22 GMT+02:00 gilbert.rebhan via SonarLint <sona...@googlegroups.com>:
if i want to scan all files from specific package(s) only

The question is: why would you want to do that? :)

I will add a FAQ entry on sonarlint.org, but as a teaser, here is a reminder of our "Fix the leak" approach regarding management of code quality: we believe that the only practical way to manage quality is to not introduce defects on the code you add/change. Doing that, little by little, your overall application quality will improve.
Of course, code that you never "touch" will not be improved. But if you never have to change some parts of the codebase, it probably means those parts are stable (or dead code :)), so why would you risk to introduce a regression by fixing quality flaws.

For various reasons (one is user asking for it), we finally added the "analyze all files" feature in SonarLint. But don't get me wrong: we don't consider it as a feature the developer should use on a regular basis. It may be used from time to time (for example when opening for the first time a project, or when SonarLint analyzers are updated with new rules) to get an overview of the project quality or just to discover our analyzers capabilities, while keeping the confort of navigating into files from your IDE. But our recommended tool for managing overall project quality is SonarQube. We'll probably never reach in SonarLint the level of filtering/sorting that SonarQube can offer, not talking about the ability to assign, comment, tag, mark issues as false positive/won't fix.

gilbert...@googlemail.com

unread,
Jun 22, 2017, 6:08:16 AM6/22/17
to SonarLint, gilbert...@googlemail.com
Hi Julien,

it's right to keep the focus on to not introduce new issues, that's beyond doubt.
But the problem is :
1. several developers work on the same branch.
2. Developer A and B introduced new issues in other classes that were pulled by Developer A
3. Developer A sees only issues for his edits in the On-The-Fly view, only minor issues, fine
3. Developer A => Git push => Build => QG failed

Means the developer needs to check for new issues by others sometimes -  not regularly.
Right now he has to open every single file that might contain new issues manually to get this information
which is pretty annoying. So a feature to optionally scan the whole project or selected packages and files is needed.
The first question of our developers was "How to analyze all files of a project ?"

Or developers will  be happy with the new "Analyze all files" Feature, but their next question will be "How to scan a selected package ?" ;-)
But that's not possible yet.
The other things they are missing are :
Better filtering in the issue views, f.e. the don't want to see minor issues, as this are not relevant for our QG
A column for sort by severity
Quick Fixes for trivial cases

Regards, Gilbert

Julien HENRY

unread,
Jun 22, 2017, 6:13:38 AM6/22/17
to gilbert...@googlemail.com, SonarLint

2017-06-22 12:08 GMT+02:00 gilbert.rebhan via SonarLint <sona...@googlegroups.com>:
Quick Fixes for trivial cases

Could you please provide examples of rules where you think a quick fix would be useful (code snippet before / after). Thanks.

gilbert...@googlemail.com

unread,
Jun 22, 2017, 8:14:34 AM6/22/17
to SonarLint, gilbert...@googlemail.com
Hi Julien,

sorry, i just listed the most common questions of our developers.
While the other requests are justified IMO, my answer to their last question if SLE provides any Quick Fixes
is always they should use Eclipse AutoSave Actions, Project /Source / Cleanup or the jautodoc plugin.
Our former audit tool (CodeProAnalytix) had a plugin with quick fixes like f.e. adding a missing documentation for a method,
but all those functionality is already handled by Eclipse or existing plugins like jautodoc,

Regards, Gilbert

Julien HENRY

unread,
Jun 27, 2017, 4:30:17 AM6/27/17
to SonarLint, gilbert...@googlemail.com
Hi guys,

The feedback period is over. Many thanks to all participants, it is always appreciated to receive feedback before the release :)

I'll proceed with the release.

++

Julien
Reply all
Reply to author
Forward
0 new messages