SonarCSS fails to parse a CSS file, probably due to JSF EL usage

(Björn Kautler) #1

The analysis logs without further information about the actual error

Failed to parse file:///.../foo.css

It is sub-optimal that it does not give any information about what parsing error happened. (Maybe this could improved too)

My guess is, that it is due to JSF EL usage, which is quite common I’d say if JSF is used.
The snippet I guess is causing the error looks like:

.question--content .ui-selectmanycheckbox div.ui-g > div.selected
	background-color: #{coreAppearanceBean.getHeaderBackgroundColorAsRgbaWithAlpha('1')};
Failed to parse some CSS files in sonarqube 7.6
(Elena Vilchik) #2

Hi @Vampire

Agree that some information about parsing error would be useful, I’ve created a ticket:

We use Stylelint under the hood to parse and analyse CSS. About JSF EL, I can’t find any information on how to support this syntax in Stylelint, so I’m afraid we can’t do anything on this side.

(Teswar) #3

Hi @Vampire

I got the same error while doing CSS files analysis. Only few files are got the parse error. Any solution please suggest me.