Need to Create the report for sonarqube pull request files alone

Hi Team,

Need a suggestions for implementing the below scenario in the sonarqube

In my devops i have been configured the job with the sonarqube,Now any Pull Request has been raised or any changes has been incoming job has been trigerring automatically,But i need some solutions in this scenario here after introducing the new code into the repository sonar qube is preparing the entire code for the sonarqube report Instead of preparing all lines i need to prepare only for the introduced lines at the time of pull request,
for example:
In the Pull request i changed the four files like
homecontroller.cs
homemodeview.cs
homeservice.cs
above mentioned files,had a certain changes for that particular changes i need a new report at the time of commit or generating the pull request for saving the time

Hi,

Welcome to the community!

It’s not clear to me what the problem is. You say pull requests are analyzed automatically. I assume you’re using a commercial edition(?). If so, what’s reported on Pull Requests should be limited to only what changed in them.

 
Ann

I am using Sonarqube in the C# code and the Project size is big. So taking 20-25 mins for full scanning. I implemented the auto scan option for every project commit/pull request time. So scanning the full project and giving the report while doing the commit, It’s taking a long time. Is there any option to scan the committed files?

Hi,

First, I should say we’re working on speed of analysis this year and an automatically-narrowed PR analysis is being proved out with Java right now. But it’s not there for C# yet.

In the meantime, it may be possible to do this by adding a /d:sonar.inclusions=[comma-deliminted list] property to your command line.

 
HTH,
Ann

Hi,
Thank you for the reply,For our scan we can’t implement sonar.inclusion concept because we are focusing on PR files,sonar.inclusion will works for particular file patterns like .cs/.js

we are focusing on particular files like
homecontroller.cs
employee.cs

If any other solution is there??

Hi,

To be clear, inclusions define a list of patterns to be included. And foo/bar/homecontroller.cs, foo/bar/employee.cs is a list of patterns. :slight_smile:

That said, I’ve been reminded that inclusions only kick in to filter .NET analysis after all the files have been analyzed, so that still doesn’t work for you. And I’m not sure there are other options. But I’ll dig a little further

 
Ann

Hi,

To follow up, we hope to produce something on this topic “soon”, but there’s nothing yet.

 
:slightly_frowning_face:
Ann