Pregunta

How can I run NDepend from SonarQube, or import NDepend results into SonarQube?

The SonarQube C# Ecosystem Plugin supports several other C# tools, but NDepend is not one of them. Commercial and free solutions are both welcome.

If no solution is available yet, can the NDepend API be used to write a custom plugin SonarQube with reasonable effort?


Update 2014-12-11: There was an announcement by the NDepend team today that a SonarQube integration is being developed. It is expected for Q2 2015. They also mention that there is a new third-party SonarQube plugin for importing NDepend results now.

¿Fue útil?

Solución

I am representing the NDepend team. Having a NDepend plugin for SonarQube is certainly a good idea and something we'd like to offer out-of-the-box in future features for NDepend vNext. It is also an idea ranked on the NDepend User Voice.

Please come back to us by email at support at ndepend dot com. We'd like to hear the details of your needs concerning import NDepend results into SonarQube.

For now writing your own plugin using NDepend.API is the way to go if you cannot wait. 100% of data collected by NDepend (structure, metrics, diff, trend...) are reachable through the API. The NDepend PowerTools source code is the right place to get started with NDepend API and see how main API usage scenarios can be implemented.

Otros consejos

While I was writing the SonarQube .Net ReSharper plugin, I looked at the potential for an NDepend plugin. The biggest obstacle is that SonarQube requires plugins to provide the full list of possible violations (rules) at server start, which must then be manually enabled by administrators via the web UI (ie: not through an API). There is no API for adding or enabling rules via the SonarQube API during plugin execution.

Once the rules are in there, it's just an excersize in associating the NDepend results with the source code lines/files. The .Net ecosystem plugins, as well as my ReSharper plugin, are all open source and can be used for inspiration on this point.

Since a lot of NDepend's power comes from the ability to easily create your own rules, a plugin author would have to create some mechanism for getting those custom rules into SonarQube without having to frequently restart the SonarQube servers. So far, no one has taken the time to do this, although it sounds like the NDepend team is considering it based on Patrick's answer to this same question.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top