Closed nirajsinha73 closed 3 months ago
Hi @nirajsinha73,
please read https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Scan-Source-Code https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Scan-Report-Files https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Troubleshooting-Configuration
Most likely it’s missing https://github.com/SonarOpenCommunity/sonar-cxx/wiki/sonar.cxx.file.suffixes
Regards,
Hi guwirth,
Thanks for your response. I have followed all the steps but still issue is not resolved. I am using below are sonar properties
C:\\apps\\sonar-scanner\\bin\\sonar-scanner.bat -e \
-Dsonar.host.url=http:\\*******:9000 \
-Dsonar.sources=%RELEASE_WORKSPACE%\\output\\precompiled\\ \
-Dsonar.projectVersion=%REPORT_VERSION% \
-Dsonar.projectName=%PROJECT_NAME% \
-Dsonar.projectKey=%PROJECT_KEY% \
-Dsonar.sourceEncoding=UTF-8 \
-Dsonar.projectBaseDir=%RELEASE_WORKSPACE%\\output\\precompiled\\ \
-Dsonar.cxx.cppcheck.reportPath=%RELEASE_WORKSPACE%\\output\\cppcheck.xml \
-Dsonar.cxx.coverage.reportPath=%RELEASE_WORKSPACE%\\output\\UTCoverageReport.xml \
-Dsonar.cxx.xunit.reportPath=%RELEASE_WORKSPACE%\\output\\iFDmgr_UT-Results.xml \
-Dsonar.cxx.valgrind.reportPath=%RELEASE_WORKSPACE%\\output\\UTValgrindReport.xml \
-Dsonar.cxx.compiler.regex="^(.*):([0-9]+): warning: (.*)\\[(.*)\\]$" \
-Dsonar.cxx.compiler.parser=GCC \
-Dsonar.cxx.compiler.charset=UTF-8 \
-Dsonar.projectDate=%PROJECT_DATE% \
-Dsonar.cxx.compiler.reportPath=%RELEASE_WORKSPACE%\\output\\make.log
-Dsonar.cxx.file.suffixes=.cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h
-Dsonar.c.file.suffixes=-
Please suggest if i need to update sonar properties.
Hi @nirajsinha73,
please turn debug logging on https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Get-Debug-Information
And compare with https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Troubleshooting-Configuration
Important is that you see source files listed below File Indexing.
Regards,
Hi guwirth Thanks For your quick response. Finally, issue has been resolved i was used wrong configuration in sonar CXX UI.
Hi guwirth
Now i am able to see the sonar dashboard but still getting code coverage 0%. Manually i have verified the coverage.xml and found that coverage report is correct.
Below are the coverage properties i have tried. but still not getting code coverage
-Dsonar.cxx.coverage.reportPaths=%RELEASE_WORKSPACE%/output/UTCoverageReport.xml or -Dsonar.coverageReportPaths=%RELEASE_WORKSPACE%/output/UTCoverageReport.xml or -Dsonar.cxx.cobertura.reportPaths=%RELEASE_WORKSPACE%\output\UTCoverageReport.xml
Hi @nirajsinha73,
please open in future a new issue for a new problem.
For importing reports read the link below, especially the Troubleshooting and .LOG file section https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Scan-Report-Files
Cobertura sensor: https://github.com/SonarOpenCommunity/sonar-cxx/wiki/sonar.cxx.cobertura.reportPaths
Most likely it’s a file path issue: the path in the report must match to the indexed source paths. https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Troubleshooting-Reports
Regards,
Hi guwirth
Thanks for your response now i am able to generate code coverage. issue is with projectBasedir location.
Hi I am using SonarQube 9.9.5 LTS and cxx plugin 2.1.1 after getting successfully execution of sonarqube no report published on sonarqube dashboard.
Below configuration using for sonarqube.
Below are the logs of sonarqube.
Below are the sonar dashboard.