1

1)There are couple of ways to analyze .net projects like SonarQube.Scanner.MSBuild or sonar-runner or sonar-scanner you can use from command line.

2)I had started using sonar-runner and it worked fine initially for C# and javascript running analysis twice - one for C# and one for javascript.

3)Now when I'm running analyis for javascript project(with jquery,require.js, bootstrape.js files) it throws an error - "parser error", "Error during sonar runner execution. Unable to execute sonar. Caused by: Java heap space". I tried increasing heap size in sonar.properties file but didn't help.

4)So I started analyzing projects using SonarQube.Scanner.MSBuild it worked but here you don't have option to specify language(or I don't know the option to specify) and due to this I'm not able to run analysis for languages(PL/SQL,Swift for which I have licence keys) other than C#,javascript.

Could anyone specify best way to analyse project for different languages from command-line.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
Rasik Bapotra
  • 35
  • 1
  • 8

1 Answers1

1

1) SonarQube Scanner for MSBuild is recommended for the analysis of .NET projects. Why? The analysis configuration for such a project is extremely difficult to write correctly by hand, and the Scanner for MSBuild takes care of all the details for you

2) Yay.

3) By the time the scanner reads your properties file, the process has already been started and its heap space set. You need to set that new value before the process starts: on the command line or in the environment

4) You have projects that contain C#, JavaScript, PL/SQL, and Swift?! If the answer were "no", I'd advise you to use the right tool for the job, and analyze your .NET projects with the SonarQube Scanner for MSBuild, and the other projects with the plain/default SonarQube Scanner. Since I know from the comments the answer is "yes" then I'll advise you to stick with the SonarQube Scanner for MSBuild for the reasons cited in #1.

Community
  • 1
  • 1
G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • I do have project that contains C#, JavaScript, PL/SQL and swift. Does SonarQube Scanner for MSBuild analyse all together? Also how do I analyse only specific project from multiple projects in my .Net solution as there is no option of specifying sonar-project.properties file with SonarQube Scanner for MSBuild. – Rasik Bapotra Nov 10 '16 at 07:51
  • 1
    @RasikBapotra Yes, you can analyze all languages together, provided that you have the language plugins installed in SonarQube. See here how to exclude projects from the analysis: http://docs.sonarqube.org/display/SCAN/Excluding+Artifacts+from+the+Analysis – Duarte Meneses Nov 10 '16 at 12:57
  • @DuarteMeneses, We have 30 projects in our .Net Solution. So its difficult to specify true in every projects which I want to exclude from anaysis. Instead of this do you have something using SonarQube Scanner for MSBuild which allows you to specify only projects that you would like to analyse. Also mention example. Also where do we specify true in .csproj. – Rasik Bapotra Nov 14 '16 at 09:17