1
votes

I am trying to analyze my application, which is a C# project, with Sonar. Therefore I configured FxCop, Galileo (with OpenCover) and StyleCop.

Seeing code violation works fine but unfortunately I cannot see any code statistics, like lines of code and so on. The only thing I see is the number of files.

Here one can see my Sonar dashboard:

enter image description here

As you can see the right side is filled with some violations (created by StyleCop because there are just "sytle errors" which confuses me a little bit, because I do not think that I did not do any major mistakes like handling wrong exceptions or something like this)

The left side is empty, just the number of files are visible.

Does anyone know, why I cannot see lines of code and the rest of this page?

As requested I am going to tel you my plugin versions and the content of the sonar properties:

Plugin-Versions:

FxCop:                          10.0
Gallio:                         3.4.14.0
OpenCover:                      4.0.1107
StyleCop:                       4.7.44.0
Sonar:                          3.4.1
Sonar-runner:                   2.0
C-Sharp-Plugins- Ecosystem:     1.4 ==> Updated to 2.0 (copied / overwrite new files to C:\sonar\extensions\plugins)

Content of sonar-project.properties (Which is in the same folder as the project and therefore also the .sln file)

# optional description
sonar.projectDescription=Some description

# Project identification  
sonar.projectKey=MyVendor:ProjectName
sonar.projectVersion= 1.0
sonar.projectName= ProjectName

# Info required for Sonar  
sources=.
sonar.language=cs

#Core C# Settings  
sonar.dotnet.visualstudio.solution.file=ProjectName.sln

Here is the list of all plugins that are located at C:\sonar\extensions\plugins:

enter image description here

1
Can you please tell us which version of the C# Plugins you're using, and also post the content of your sonar-project.properties file?Fabrice - SonarSource Team
I edited my question as requested :)Metalhead89
I updated the C-Sharp-Plugins- Ecosystem to V2.0 but I have still the same problem. I closed the cmd running sonar, restarted sonar with the StartSonar.bat and I also "restarted" (sorry but I just couldnt find a perfect word for that) my project with the sonar-runner commandMetalhead89
In the plugins folder I do have the sonar-csharp-plugin-2.0 jar file. I also added a picture of all my other plugins I have "installed"Metalhead89

1 Answers

2
votes

You forgot to specify the source encoding for your project. From your comments, it looks like your files are encoded in UTF-8, so you should add the following:

sonar.sourceEncoding=UTF-8

If this is not UTF-8, force the encoding to whatever it should be.