How can I deactivate not used Languages


I’m start with my first project in SonarQube and will check it with the sonar-scnner CLI tool.
Now I becomes some errors from Java and co by an only C/C++ project. No other files are included into the compiler JSON file.

The following errors have I see:

  • Node.js not found in the Path
  • solved with installation of Node.js on the machine which running the sonar-scanner
  • Error: Cannot find module ‘postcss-markdown/extract’

Now that comes all from not used languages. How can I deactivate not used languages in a project? I need only C and C++.

Thanks for our help,

Hey there.

The scanner must be indexing some files that match the file extensions defined for Javascript/Typescript/CSS.

You can make sure these files aren’t in the directory you’re scanning, or narrow the focus to exclude them (sonar.exclusions=**/*.js,**/*.ts,**/*.css) for example.

What is the correct place to configure this project settings? On the SonarCube server or in the project itself?

You can set this globally (if you really want to impact all projects) at the global Administration level. If different projects have different requirements, it is better to set at the project-level.

In both administration sections, you can configure this under the Analysis Scope section. Alternatively, you can pass this information at analysis time.

Thanks. So I’ve read a solution in the web, than I can configure the file extension to an not exists name (like “.foot”).
So I’ve check it and then configured the extensions to the exclusion. But not all languages are disabled with this. So, example, the XML checker is active.
Also I see that some default file extension is written with “.” and other wihtout “.”. What is the correct value? What is when I write all with “.” or wihtout “.”?