which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
**SonarQube 8.9 LTS
** sonar-scanner-cli-4.6.2.2472-macosx
** build-wrapper-macosx-x86
what are you trying to achieve
scan an iOS project written in objective-c and C++
what have you tried so far to achieve this
I followed the guide in the documentation in https://docs.sonarqube.org/8.9/analysis/languages/cfamily/
The analysis report on SonarQube server shows code smells and duplications but it shows 0 bugs.
I tried to scan pure Objective-c project and it is working fine.
I am not sure you are properly configuring the analysis. Looking at your log you are having only /Users/serv_jenkinsmacos/jenkins/workspace/iOSWorkspace_PR-55/MobiControl/iOSWorkspace/iOSAgent/Carthage/Checkouts/** files being analyzed which are dependencies.
Could you share the debug log of the analysis? You can add sonar.verbose=true property to get it.
You should look at having:
build-wrapper to catch a clean build
analysis to be correctly configured with a good sonar.sources property.
I am not sure you are properly configuring the analysis. Looking at your log you are having only /Users/serv_jenkinsmacos/jenkins/workspace/iOSWorkspace_PR-55/MobiControl/iOSWorkspace/iOSAgent/Carthage/Checkouts/** files being analyzed which are dependencies.
That is exactly the problem, if I remove this dependency I get an error that 0 files scanned. As if the project files are not being seen as objectiv-c code.
I need to analyze /Users/serv_jenkinsmacos/jenkins/workspace/iOSWorkspace_PR-55/MobiControl/iOSWorkspace/iOSAgent/iOSAgent
which is my project.
please see the requested attachements.
and this is how I run the build-wrapper and the scanner:
the reason why your source files are excluded is that you are compiling them as objective-c++, in the build-wrapper-dump.json file your source files are compiled with option -x objective-c++. We don’t support objective-c++, are you really using objective-c++ or can you set the language to objective-c?
you are building your project in objective-c++ mode, is that intended? Do you really have some code that is a mix of objective-c and c++? Isn’t it that maybe that is not intended and you have just objective-c or c++ code?