0
votes

It was a long WTF moment and I could not find any information on the issue, so I decided I put it here.

Setup: Windows 7 x86_64, sonarqube-4.3, sonar-runner-2.4, jre 1.7.0_55-b14

I followed quick start guide to configure Sonar.

I copied sonar-project.properties from a sample to my solution, put it in the directory with .sln, and made necessary adjustments:

sonar.projectKey=org.whatever.project
sonar.projectName=Project
sonar.projectVersion=2.0
sonar.sourceEncoding=UTF-8
sonar.sources=.
sonar.visualstudio.enable=true

Problem: Analysis ran without any exceptions but only C# files were analyzed.

2

2 Answers

0
votes

Long story short, following line in config was causing the issue:

sonar.sources=.

After moving sonar-project.properties one level up and changing it accordingly, the problem was resolved.

sonar.sources=src

0
votes

I think it actually relates to the usage of the Visual Studio Bootstrapper. Can you try the same without it?

Here is what happens: The Visual Studio bootstrapper reads all the <Compile> tags from the *.csproj files to determine which files must be imported. Javascript files are not referenced by <Compile> (as they do not need to be compiled), and will therefore not be imported in SonarQube.

See this related Jira ticket: https://jira.codehaus.org/browse/SONARVS-27