Do not process analyses on server side

Hi,

For some of our internal use cases, I’d like analyses to not be processed on server side (I don’t want to send the report to the SonarQube server). How can I prevent this step from being performed?

Thank you

Regards

Nicolas

Hey Nicolas,

Sorry, this isn’t possible. Can you go into more detail about why you don’t want the analysis to be processed by SonarQube?

Hey Colin,

Our plugin has a sensor that generates some graphs for developers to better understand their project design. This sensor is triggered after source code parsing.

This is only useful for developers locally in their IDE. For now, developers run sonar-scanner on a regular basis to refresh those graphs as they code. But, it greatly increases SonarQube server load for no added value at all. That’s why, we’d like to know if we could easily disable the step that sends the analysis report to the SonarQube server. We would ask developers to add a parameter to their sonar-scanner command locally to disable this step.

SonarLint seems to be able to run some sensors without pushing any report to the server. There’s no way to achieve the same with sonar-scanner?

Thank you

Regards

Nicolas

Are the graphs generated locally or pushed/viewed on the SonarQube?

It sounds like something that can be orchestrated with the sonar-scanner, but that it wasn’t really designed to be used for.

Yes, but it’s all done quite carefully to not tax the IDE. For sensors extending SonarQube’s APIs, Custom rules written in Java will run in SonarLint if SonarLint compatibility is properly notated in the custom plugin manifest, see this example for the syntax.

Maybe that’s enough to make the sensor run in SonarLint?

Are the graphs generated locally or pushed/viewed on the SonarQube?

No. It would be nice to be able to add images to issue messages. But, it’s not possible. See Add link and image to issue message

Maybe that’s enough to make the sensor run in SonarLint?

We’re not running SonarLint, just a standard analysis through sonar-scanner.
To fix my issue, I added a sensor that just checks a boolean parameter. If this parameter is set to true by the developer through command line, then analysis will just stop after graphs have been generated. Nothing will be sent to the SonarQube server. It’s maybe not the more elegant way but it works fine.