SonarQube version: 188.8.131.5243
Jenkins version: v 2.150.1 LTS
SonarQube Scanner for Jenkins plugin version: SonarQube Scanner 184.108.40.2067
SonarCFamily plugin version: SonarCFamily 220.127.116.1116 (cpp)
Server OS version: Windows Server 2016 10.0 amd64
Java version: Java 1.8.0_201 Oracle Corporation (64-bit)
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’ "
Checked for component updates.
Tried modifiying Jenkins job analysis properties
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
could you please share the sonar-scanner log?
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 I include the -X additional argument to get verbose logs
- After this is just clean-up
I’ll reply soon with a redacted log.
I attached a recent redacted Jenkins sonar log: jenkins-job-sonar-log.txt (37.8 KB)
Thanks for your help,
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.
Do you know if there are any compatibility issues with TI Compilers? Note, this used to work for our team.
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?
Right now we are using Code Composer Studio (Eclipse based) with Texas Instruments compiler v18.1.5 LTS
Also, we don’t have any problem using SonarLint which is scanning the code and showing us the expected issues.
yes, SonarLint for Eclipse is compiler agnostic. Unfortunately we don’t support any Texas Instruments compiler at the moment, as documented at https://redirect.sonarsource.com/plugins/cpp.html.
What platform compiler are you using from Texas Instruments compiler v18.1.5 LTS?
We use the C2000 TMS320F28x C/C++ Compiler
no promise and ETA but I created a dev ticket to track the request and traction for TI C2000 compiler: CPP-2094
I understand. Thanks @mpaladin