Using only the issues that are imported from a cppCheck.xml file

  • Community Edition
  • Version 8.9.2 (build 46101)

I am currently using an offline misra check tool to generate my cppcheckReport.xml file and then I want to pull just these results into sonar cube. I do not want sonar cube to run any more scans or analysis. However, I am having problems with the second part. When I run, it pulls in the results from the xml file just fine. However, it also runs it’s own scan and merges the results so I get 126 issues from my scans and 1055 code smells from sonarcube scans. How do I prevent sonar cube from running its own scan of the project and merging the results. I am thinking I need to change something in my project settings or something in the properties files but I do not know for sure. I have tried changing some wildcards but to no avail. Below is the command line and the settings file.

How do I prevent sonar cube from running its own scan of the project and merging the results.

[2022-01-27T20:11:21.307Z] [Pipeline] {
[2022-01-27T20:11:21.342Z] [Pipeline] isUnix
[2022-01-27T20:11:21.373Z] [Pipeline] sh
[2022-01-27T20:11:21.970Z] + cd src/test/firmware/crc32/crc_unit_tests.X
[2022-01-27T20:11:21.971Z] + sonar-scanner -X -Dsonar.host.url=http://sonar.XXXXXXX.com -Dsonar.login=YYYYY -Dproject.settings=sonar-project-internal-server.properties -Dsonar.c.cppcheck.reportPath=cppcheckReport.xml -Dsonar.projectKey=com.YYYYYY.bootloader16:bootloader16bit_misra
[2022-01-27T20:11:22.236Z] 20:11:21.162 INFO: Scanner configuration file: /opt/sonar-scanner-4.2.0.1873-linux/conf/sonar-scanner.properties
[2022-01-27T20:11:22.236Z] 20:11:21.166 INFO: Project root configuration file: /home/jenkins/agent/workspace/bootloader16_PR-881/src/test/firmware/crc32/crc_unit_tests.X/sonar-project-internal-server.properties

sonar-project-internal-server.properties
--------------------------------------------------

# required metadata 
sonar.projectKey=com.YYYYYY.bootloader16:bootloader16bit_misra
sonar.projectVersion=0.0.2
sonar.language=c
sonar.scm.disabled=true
sonar.lang.patterns.c++=-
sonar.lang.patterns.cov-cpp=-
sonar.scm.exclusions.disabled=true
sonar.projectBaseDir=.
sonar.sources=.
sonar.exclusions=**/*.py,**/*.html,**/*.htm,**/tool-misra-report-to-cppcheck-xml/**

is any solution? I met the same problem :face_exhaling:
I use sonar.inclusions=xxx.c , it’ll not index more files