Dear Community
- Operating system: Windows 10
- SonarLint plugin version: 10.23.0.81344
- Programming language you’re coding in: C++
- Is connected mode used: problem exists in connected and unconnected mode as well
- Connected to SonarCloud or SonarQube (and which version): SonarQube
- IDE Version: CLion 2024.3.1
We are have a Sonarqube project which we could create by using a pipeline. It triggers an analysis on Sonarqube whenever we merge a branch into the dev. We use Docker container (Linux) and gcc and CMake.
Whenever, we trigger the analysis using our pipeline, Sonarqube does its job and analysis the project.
However, when we use Sonarqube as a plugin to start an analysis locally within CLion, it states “Provided compiler is not compatible Invalid probe found, skip analysis of files: [/main.cpp]”.
We could set up a connection to Sonarqube, because we can choose our project in a drop down list in CLion and also in the logs it states the correct amount of rules it has in the selected quality profile.
Interestingly, neither in the pipeline nor locally we provide any information about the compiler or similar, since it is all configured within the Dockerfile. This file however is not content within sonarqube analysis, therefore the analysis on the server (triggered by pipeline) should not be aware of the gcc.
Since it is the start of an important project we want to ensure a high quality code from the beginning. Direct feedback to the developer is crucial.
What can cause this problem? Is there anything we need to additonally provide for the analysis?
Here is our pipeline from AzureDevOps:
- task: sonarsource.sonarqube.SonarQubePrepare@7
displayName: 'Prepare analysis on SonarQube'
inputs:
SonarQube: SonarQube
scannerMode: CLI
configMode: manual
cliProjectKey: 'Firmware_$(FWName)'
cliProjectName: 'Firmware_$(FWName)'
cliProjectVersion: 'V$(fullversion)'
extraProperties: |
sonar.cfamily.cache.enabled=false
sonar.cfamily.threads=1
sonar.sourceEncoding=UTF-8
sonar.exclusions=<folderName>/**
- task: sonarsource.sonarqube.SonarQubeAnalyze@7
displayName: 'Run Code Analysis'
inputs:
jdkversion: 'JAVA_HOME'
- task: sonarsource.sonarqube.SonarQubePublish@7
displayName: 'Publish Quality Gate Result'
Best regards
Robert