I am using sonar qube for analysing C files. I am not able to see the complete smells listed for C/C++ after analysis. For example Divide by Zero error is not listed in the code smell.
My sonar scanner settings is reconfigured for C language using the option sonar.language=c
and used C language specific tags like, sonar.c.include directories
. I am getting Lexer errors for the C files.
Can anyone help me to solve this.
You can do analysis for free with SonarOpenCommunity/sonar-cxx. However, you need an external tool such as cppcheck in your dev machine to produce its results in XML format in a file.
Here is how I was able to do it:
sonar-c-plugin
. For my version of sonarqube 5.6.1 I got this from https://github.com/SonarOpenCommunity/sonar-cxx/releases/download/cxx-0.9.8/sonar-c-plugin-0.9.8.jarbuild/cppcheck.xml
Here is my sonar-project.properties file:
C an C++ are supported in SonarQube only with the paid Developer Edition or more expensive editions from SonarSource. If you are running SonarQube Community Edition this may be why you are getting these lexer errors or otherwise unable to scan C files.