Sonarlint analysis scope for new/modified code

865 views
Skip to first unread message

mathur...@gmail.com

unread,
Nov 2, 2016, 10:21:09 PM11/2/16
to SonarLint
Hi SonarLint team

We are applying Sonar Qube to produce quality code for our customers.
In this endeavour we are trying to use "Sonarlint for visual studio" to determine pre-commit issue at developer desktop but we are facing an issue.

Actually we have lot of legacy code which has lot of quality issue which we are unable to fix instantly and would take time to fix all the previous issue.
We want to keep this data as a baseline for further analysis. Currently Sonar lint shows all the issues wheather it is from previous code or new code.

We want to restrict sonarlint alaysis only for the latest modified/added code.

I also tried to use sonar.analysis.mode = 'incremental' but
first of all it seems server side property and not available in visual studio plug-in.

Secondly, If it works, even then, it would alaysis the whole modified file, not modified code which does not
resolve our purpose

Could you please suggest how solarlint can be manipulated to achieve this? is it possible?
Please let me know for more information.

Regards,
Umang Mathur

amaur...@sonarsource.com

unread,
Nov 3, 2016, 12:29:38 PM11/3/16
to SonarLint, mathur...@gmail.com
Hello Umang,

Thanks for using SonarQube.

To answer your question, no it is not possible to filter down to only new bugs/code smells within Visual Studio. But if you connect to your SonarQube server and navigate to the main page of your product, you can have a look at the Leak Period (on a yellow background) to identify them. More information on the Leak Periodhttp://docs.sonarqube.org/display/SONAR/Setting+the+leak+period

We actually want to provide a seamless experience for the user in its IDE and as it is not currently possible to identify errors' date (nor to filter them) in Visual Studio then we don't provide this feature.

I hope this answers your question,

Kind regards,
Amaury

martinbla...@gmail.com

unread,
Feb 8, 2017, 9:56:08 AM2/8/17
to SonarLint, mathur...@gmail.com
Hello Amaury,

we are also introducing SonarQube with SonarLint into our daily work and have the same problem.
But we use the current IntelliJ-Plugin in Version 2.7.1.

It would be great to differentiate between the analysis during coding and during commit.
You see all legacy and new issues in the code during coding that's fine.
But in the pre-commit analysis it would be necessary to only bother the developer with new issues in the "SonarLint Analyis Results"-Messagebox.
Therefor a new "Analysis propertie" would be great. Is this something on your roadmap?

Thank you !!

duarte.meneses

unread,
Feb 13, 2017, 3:37:08 AM2/13/17
to SonarLint, mathur...@gmail.com, martinbla...@gmail.com
Hi,

We don't plan to introduce those kind of analysis properties in SonarLint. The goal of SonarLint is to simplify configuration and to work out of the box, because it has the advantage of being able to take a lot of configuration data directly from the IDE.
We have been discussing internally how to better support legacy projects and some features will come soon to improve it. One of them will probably be the ability to distinguish new issues from other issues.

vinodko...@gmail.com

unread,
Nov 28, 2017, 9:11:48 AM11/28/17
to SonarLint
Hello Amaury,

I too work on a legacy project, I want to do analysis only for the code that is added after a particular date. I found the cutoff plug does the same thing but it was deprecated after sonar 4.0 version. Currently I am using sonar 5.1 version. Is there any way to fulfill my requirement.

Thanks,
Vinod K 

Amaury Leve

unread,
Dec 1, 2017, 3:00:31 AM12/1/17
to vinodko...@gmail.com, SonarLint
Hi Vinod,

Not sure what's this cutoff plugin you are mentioning but for now we have no way to provide this feature on SonarLint for Visual Studio. Feel free to upvote this ticket to increase its priority: https://github.com/SonarSource/sonarlint-visualstudio/issues/280

Cheers,
Amaury

--
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/4951c55f-2546-4c0b-84b5-e38c165a469e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 
Reply all
Reply to author
Forward
0 new messages