Language set to 'PHP' but it wastes build time looking for JavaScript, VB and such

  • Build environment on GitHub Actions:
SonarScanner 4.7.0.2747
INFO: Java 11.0.15 Alpine (64-bit)
INFO: Linux 4.15.0-123-generic amd64
  • what are you trying to achieve

I noticed in the output there are unnecessary steps, for example:

Sensor JavaScript inside YAML analysis [javascript] (done) | time=6781ms

There are others such as C#, VB.NET, PLSQL, CSS, HTML but the above adds 7s to the build time for no gain (for this project).

  • what have you tried so far to achieve this

I’ve set:

sonar.language=php
sonar.php.file.suffixes=php

Is there a way to only turn on certain sensors?

Hi,

sonar.language was deprecated for multiple years before it was removed. As you’ve seen, it has absolutely no effect.

There’s not. You can only minimize their execution time. I assume, from the fact that the sensor is taking 7s that you have relevant files in your project(?). You can skip these 7s by narrowing your analysis to only PHP files using an inclusion pattern like **/*.php.

 
HTH,
Ann