Disable CSS analysis in HTML files?

Hi,

I’m setting up SonarQube 8.7 and Jenkins to scan a repository that contains around 1200 C# files and exactly 1 HTML file (55 lines). Initially the scan produced this warning (note the 20 second delay before the warning):

[2021-03-02T14:16:09.003Z] INFO: Sensor CSS Rules [cssfamily]
[2021-03-02T14:16:30.915Z] WARN: CSS rules were not executed. Error when running: 'node -v'. Is Node.js available during analysis?

When I made Node.js available it was able to scan the CSS in this 1 file but it took 18 seconds.

[2021-03-02T19:04:36.698Z] INFO: Sensor CSS Rules [cssfamily]
[2021-03-02T19:04:54.762Z] INFO: 1 source files to be analyzed
[2021-03-02T19:04:55.020Z] INFO: Sensor CSS Rules [cssfamily] (done) | time=18299ms

Why is it so slow to analyse 30 lines of CSS in 1 small HTML file? Can I disable scanning of CSS in HTML files (I can see how to disable CSS analysis for .css files but not for .html)? Alternatively, can I tell the scanner not to use Node.js?

1 Like

Hi, I also want to disable the scans for HTML and CSS. how can this be done ?

Hi,

Since recently CSS analysis is done together with JS/TS so it should take less time for CSS. If you still want to skip those files you can set them sonar.exclusions but be aware that HTML rules will also be skipped.