Scanner - Failed to parse file

I am using the scanner on a HTML, JS project and getting a lot of files failing to parse.

The first one was a css file which was failing on the line below because the semi-colon is in the wrong place, it should be after the important. Confused as to why this failed the whole file and didn’t just come up as a bug in SonarQube.
.no-padding{ padding:0px; !important }

Most of the other files are failing as we are using the files as templates through a custom backend and they include syntax such as <#firstname> <#surname> etc The scanner fails to parse the whole file because of these. Is there an option somewhere to allow this syntax, they are always in the format <#text> so perhaps a pattern can be setup?

Hi Simon,

Please remember to share the must-have information when posting here, e.g.: version of SonarQube that you are using, the analysis logs, etc.

To come to the two different issues you mention:

  • The CSS syntax you are sharing as example is invalid and will make the scanner simply unable to parse the CSS/HTML file. This is not a bug (compilable and executable code producing unwanted results) but invalid syntax (the code cannot be compiled nor executed as it is written).
  • The custom syntax you refer to (<#text>) injected to your custom templating cannot be interpreted by the scanner parser. You can either feed the result of this templates in valid, common HTML or alternatively write your own custom SonarQube plugin.

Hope it helps, cheers,
Daniel