Information SonarQube version: 7.5.0.20543 Jenkins version: v 2.150.1 LTS SonarQube Scanner for Jenkins plugin version: SonarQube Scanner 3.2.0.1227 SonarCFamily plugin version: SonarCFamily 6.0.0.10816 (cpp) Server OS version: Windows Server 2016 10.0 amd64 Java version: Java 1.8.0_201 Oracle Corporation (64-bit)
Problem:
The Jenkins job using sonar scanner plugin does not analyze any of the C code of which it generates metadata.
Only code smells related to duplicated code are being reported in SonarQube. We have near 100K lines of code and SonarLint shows many errors that aren’t being reported.
Multiple files were "indexed with language ‘c’ " and show " generated metadata with charset ‘windows-1252’ "
Notes:
We set Jenkins job analysis properties for sonar.projectKey, sonar.sources, sonar.cfamily.build-wrapper-output, sonar.sourceEncoding, sonar.exclusions
Our server is running both Jenkins & SonarQube
I’ll need to redact some items from the log, but for the time being, let me outline our Jenkins build setup.
Our source code is in a git repo, and we only build off of our master branch.
We run Code Composer Studio (Eclipse based) to clean the project directory
We use the following as an ‘Execute Windows batch command’ to run the build wrapper
::This is modified from src\build.bat for use by sonar analysis build wrapper
D:\sonarqube-7.5\build-wrapper-win-x86\build-wrapper-win-x86\build-wrapper-win-x86-64.exe --out-dir D:\Jenkins\workspace\redacted_project\sonar_build_report C:\ti\ccsv8\eclipse\eclipsec.exe -noSplash -data workspace_redacted -application com.ti.ccstudio.apps.projectBuild -ccs.workspace
We ‘Execute SonarQube Scanner’ with analysis properties as follows:
Also, our core issue right now is not being able to scan our C code with our Jenkins build. If there is another scanner that we should use or a different configuration that we should try, please let me know.
Thanks!
-Wes
the list of supported compilers is available at this page. If you are not using a supported compiler it is expected that you don’t get your files analyzed. What compiler are you using?