3

I have been trying to get Sonar code analysis work on a c# project. Since it's a web project I'd also like to run analysis on JavaScript.

However, as mentioned in the following link, you cannot run multi-module projects on a .NET solution (http://sonar.15.x6.nabble.com/Multi-language-javascript-amp-c-td5011530.html). The suggested workaround is to trigger two analysis profiles separately and then combine them with the views plugin (http://www.sonarsource.com/products/plugins/governance/portfolio-management/)

But this plugin costs about 1800$. Because Sonar has the possibility to analyse multiple projects in .NET through the solution file, it therefore disables multiple modules for .NET solutions (to prevent a specific error).

I find it really annoying that by doing this, it forces me to use a paid module (and not a cheap one) to create a sub-optimal workaround.

Are there any other better solutions for this?

Kenneth
  • 28,294
  • 6
  • 61
  • 84
  • Did you able to make it work? I am trying to do the same but unfortunately i get some error. Could you please check my post https://stackoverflow.com/questions/51878860/sonarqube-and-lcov-report-could-not-resolve-file-paths – Murali Murugesan Aug 22 '18 at 11:29
  • I haven't worked with Sonar in a long time, so unfortunately, I'm not able to help you. However, according to the comments on the answer below, it's now possible to analyse VS.NET solution for C# and JS – Kenneth Aug 22 '18 at 13:58

1 Answers1

1

No, there's currently no better solution for this case. This issue has been identified and we'll take a look at it during the next spring - but I'm not sure that it can be solved easily though.

You can and watch and vote here: http://jira.codehaus.org/browse/SONARDOTNT-291

  • I understand that it is hard to solve. What I don't understand is then the reason to make a workaround that expensive. Would there be a possibility to create a basic free version of that component so we could at least circumvent the problem? – Kenneth May 27 '13 at 08:32
  • You get it wrong Kenneth. The Views plugin is not meant to be THE workaround for that case: this is a more generic plugin (that existed before the C# plugins) which purpose is to handle application portfolio management. And fortunately it can be applied to solve your case until we find a good way to handle this. Also, please keep in mind that the Views plugin (and the other commercial ones) are what allows us to make a big part of the Sonar ecosystem free to use... – Fabrice - SonarSource Team May 27 '13 at 08:50
  • Hi Fabrice, I think you understood me wrong. I meant that the workaround was made expensive, not that a workaround was made for this case. I certainly understand that there needs to be some kind of funding to make the rest free. I hope you also see my problem. I don't need to handle a big application portfolios, I just want to handle a very basic use case, which is possible with all languages except for .NET. I would offer help to implement this feature, but unfortunately I'm a .NET developer and Sonar is built with JAVA, so it would be rather difficult to provide a valuable contribution. – Kenneth May 27 '13 at 10:34
  • OK, so let's wait for SONARDOTNT-291! :) – Fabrice - SonarSource Team May 28 '13 at 08:39
  • @Fabrice-SonarSourceTeam That problem ticket doesn't appear to exist anymore; is this still fix still in the works? Cheers! – Scottie Dec 09 '15 at 17:33
  • 1
    @Scottie This question is very old... and so is my answer! It is now possible to analyse VS.NET solutions containing both C# and JS. – Fabrice - SonarSource Team Dec 10 '15 at 09:45
  • Could you provide the solution or more information please? I want to analyse a solution and a JS app which are located side by side in one directory. – ChW Mar 19 '18 at 17:10
  • @Fabrice-SonarSourceTeam Unfortunately I could not able to use C# and JS together with MSBuildRunner https://stackoverflow.com/questions/51878860/sonarqube-and-lcov-report-could-not-resolve-file-paths – Murali Murugesan Aug 22 '18 at 14:36