1

I'm using SonarQube v5.0 with MS Build Sonar Runner, C# plugin v4.3 and OpenCover for Code Coverage.

I have two QualityProfiles. 1. With only SonarQube rules. 2. With only FxCop rules.

Using SonarQube rules QualityProfile, everything works fine. Issues are get posted in the dashboard. But when I use FxCop rules only QualityProfile, no issues are get posted in dashboard.

It shows Technical Debt - 0 and Issues- 0.

I have referred to MsbuildSonar Runner +Fxcop - No fxcop issues are posted to server.SonarDashBoard shows 0 technical debt where this user faced same issue. But after changing his database Collation with CS_AS, his issue got resolved.

But this is not happened for me. Even after recreating my database with Collation CS_AS (Latin1_General_CS_AS), FxCop issues are not get posted in Dashboard.

NOTE: I can see the CodeAnalsisLog.xml in output directory having 163 warnings. Also in ProjectInfo.xml, there is an entry for AnalysisResult with ID - FxCop.

Don't have any idea that why FxCop rules are not get posted in dashboard.

Community
  • 1
  • 1
Karthik V
  • 21
  • 5
  • Can you check if the CodeAnalysisLog.xml file contains references to source files and lines? If not, it can be due to missing *.pdb files, or to particular rules that report on assemblies or class fields, for which no mapping back to source code can be made. The C# Plugin requires the path and line to be present. Also, try to add the `/d:sonar.verbose=true` to the begin parameters to see more detailed logs during the analysis. – Dinesh Bolkensteyn Dec 18 '15 at 12:09
  • CodeAnalysisLog.xml file is available and its path is correctly set in projectinfo.xml. further I checked by adding /d:sonar.verbose=true in the begin command. I can see a log "Skipped FxCop issue at the line as the file is not in the SonarQube" for all FxCop issues. I'm executing the SonarQube commands and building the project in the same directory. Also .pdb file is available in bin\Debug directory. Can you suggest me how to fix this issue?? – Karthik V Dec 18 '15 at 15:46
  • And CodeAnalysisLog.xml contains correct references to source files and lines. – Karthik V Dec 18 '15 at 15:58
  • Is your project a test one? We do not import issues on test projects in SonarQube. You should be able to check that from the generated `.sonarqube\out\sonar-project.properties` file: check whether your project files are listed with `sonar.sources` or `sonar.tests` – Dinesh Bolkensteyn Dec 21 '15 at 08:12
  • No. It's not a unit test project. I checked the .sonarqube\out\sonar-project.properties file for sonar.sources. it has references to all .cs files in my project with the absolute path. – Karthik V Dec 21 '15 at 10:53
  • Can you reproduce this on a smaller project? If so, could you share that one (including its `.sonarqube` folder and full analysis logs with `sonar.verbose` set to true) for investigation? – Dinesh Bolkensteyn Dec 21 '15 at 16:20
  • I'm trying with a smaller project only..but unfortunately I couldn't share with you as I'm doing this at my ofc.. Give me a couple of days I will try this in my personal pc and share you.. – Karthik V Dec 21 '15 at 18:31
  • And is there any command that store full analysis logs in a txt file?? – Karthik V Dec 21 '15 at 18:33
  • Use the > batch operator to redirect stdout to a file – Dinesh Bolkensteyn Dec 22 '15 at 08:14
  • @Dinesh-SonarSourceTeam hi Dinesh, Sample project is ready. Could you pls tell me how to share with you? – Karthik V Jan 06 '16 at 07:24
  • hi Dinesh.. it would be helpful if you could help us at the earliest.. – Karthik V Jan 12 '16 at 14:08
  • just upload it somewhere and put the link here. Make sure there's no confidential code in it though as it's going to become public – Dinesh Bolkensteyn Feb 25 '16 at 10:58

0 Answers0