Skip to content

sonar.cxx.file.suffixes

guwirth edited this page Mar 10, 2021 · 12 revisions

The analsis parameter defines a list of suffixes of CXX files to analyze.

The reading in of source files (indexing) is a prerequisite for the subsequent reading in and visualisation of reports of external tools. The programming language sensor is often also called squid sensor.

In SonarQube, each file extension must be uniquely assigned to one programming language. When operating several C/C++ plugins in parallel, this must be taken into account during configuration. To avoid problems on a server with multiple C++ plugins, the CXX programming language sensor is disabled by default.

sonar-project.properties sample:

# default: the _cxx plugin_ language sensor is disabled
sonar.cxx.file.suffixes=-

This configuration parameter must therefore be set explicitly to use the CXX programming language sensor. The recommended settings are:

programming language recomended file suffixes
C++ .cc,.cpp,.cxx,.c++,.hh,.hpp,.hxx,.h++,.ipp
C .c,.h
CXX (v1.x) .cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h

Sample to be cxx plugin version 1.x compatible (sonar-project.properties):

# mandatory parameter: files to be handled by the _cxx plugin_
sonar.cxx.file.suffixes=.cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h

Hint: The SonarCFamily for C/C++ is using the analysis parameter sonar.c.file.suffixes for C and sonar.cpp.file.suffixes for C++.


Troubleshooting

TODO: add LOG file items/samples if configured correctly or wrong

Clone this wiki locally