I added empty line for check the line number of sonar analysis report. The line is empty. But I fixed my issue by running only sonar-scanner command with the line of ‘sonar.coverageReportPaths=sonarqube-generic-coverage.xml’ in sonar-project.properties file.
But I have already struggled with issue to sonar analysis report to sonar side. I added sonar zip file that contains sonarqube-generic-coverage.xml, xccov-to-sonarqube-generic.sh, run-sonar-swift.sh, sonar-project.properties (without login key) and all terminal log with executed sh file and bash command for generic coverage file.
I don’t understand where it’s coming from either, but inclusions and exclusions are not… exclusive. As you see, you can have both and the same things can appear in both.
I did glance at your properties file, and saw that there’s a lot going on in there, with a lot of properties I don’t recognize (i.e. that have no effect on analysis).
I suggest you strip this down to the bare minimum by removing your properties file and just providing URL, project key and token on the command line. See if that gets you what you want, and build back up from there.
First, none of the sonar.swift properties shown in your sonar-project.properties file are having any effect. That’s one reason I advised you to provide the bare minimum on the command line. As described in the docs parameters provided on the command line override all others. And since neither of us knew where that *.swift exclusion was coming from, that seemed like the best place to try to provide a definitive property set. But oh well.
You’re saying the analysis you got is not correct, but from the fact that you’ve got a project homepage in the UI, it appears that analysis did work.
So what’s not correct about this? Could you provide a screenshot of the Size metrics on your Measures tab? (Or whatever measures you feel are most relevant?) E.G.
Code is empty on sonarqube, I know project have a dublication of codes (%9.9 percent) but I haven’t seen any of code duplications and any unit test coverage on sonarqube.
I fixes issue by removing xctestresult file inside DerivedData folder.
After that, clean project, build and test respectively. Then execute bash command for generating generic coverage ( bash ./xccov-to-sonarqube-generic.sh DerivedData/Logs/Test*.xcresult/ > sonarqube-generic-coverage.xml).
All problem fixes. Also coverage report has succesfully migrated to sonar platform.