0

Explanation:

I've developed a plugin that scans through a project for xml files with a particular name, and performs some parsing logic that determines backwards compatibility of changes made to certain subsets of the project code. Right now I have a widget on the sonarqube dashboard which displays information regarding the number of non backwards compatible issues detected after checking these xml files.

Question:

I would like to enable the functionality in the plugin to add the xml files that have a non-backwards compatible flag to the 'Issues' tab, with a critical severity set. Developers in the team could then hopefully see these issues added to the overall issue count rather than checking on a dashboard widget alone. I have a Metrics, Sensor, Plugin and RubyWidget class after extending the reference plugin, as well as my own classes that add the functionality of finding the files and performing the parsing logic.

Is there a class I can extend to add this new issue to the issue count and grant users the ability to inspect the xml files to see the description of the issue itself?

How can I incorporate this functionality? Thanks.

1 Answers1

0

You need to provide an implementation of org.sonar.api.server.rule.RulesDefinition and to add its class to the getExtensions() method of your plugin class. From a sensor, you can then create "issues" on the project files for the rules you have defined.

As an example, you can check how the SonarQube example plugin defines a rule and creates issues for that rule.

Pierre-Yves
  • 1,476
  • 10
  • 15
  • Hi, thanks for the reply. That definitely helps with the direction to go now knowing which classes to leverage. The link seems to be using 5.2.2 sonarqube, whereas I'm using 5.2. Is there an example of an issue implementation in sonar 5.2? –  Dec 15 '15 at 17:47
  • Why 5.2.2? I don't think that such version exists at the moment. – Pierre-Yves Dec 17 '15 at 09:45