ozzi
(Ozzi )
June 22, 2022, 11:00am
1
SonarCloud does not seem to recognize HTML lang declarations when using Thymeleaf - a HTML template engine, which means my lang tag is called “th:lang” instead of “lang”
Any chance this could be added to Sonar?
The following example HTML will trigger Web:S5254
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" th:lang="${#locale.language}" th:xmllang="${#locale.language}" >
<head>
<title>Example</title>
</head>
<body>
</body>
</html>
Colin
(Colin)
June 22, 2022, 11:07am
2
Hey there.
I’ve moved your post to the section on reporting false-positives. Please be sure to read this post:
Hey SonarSource Community!
False-positives happen , as do false-negatives, and we’re eager to fix them. We are thrilled when our users report problems, so we can make our products better.
What is a false-positive (FP)?
A false-positive is when an issue is raised unexpectedly on code that should not trigger an issue, or where the suggested action doesn’t make any sense for the code.
What is a false-negative (FN)?
A false-negative is when an issue should be raised on a piece of code, but isn’t…
And include the version of SonarQube you’re using, and a reproducible code snippet (not a screenshot).
1 Like
ozzi
(Ozzi )
June 22, 2022, 11:23am
3
Hi Colin
Thank you for moving it, I added the information my post was lacking, sorry about that.
We are using SonarCloud, I am therefore unsure if it has a specific version.
Cheers
Hey @ozzi ,
Indeed, this is a false positive and should be considered in the analyzer. I’ve created a ticket to track this: [SONARHTML-160] S5254 should not raise an issue when the lang is specified with Thymeleaf attributes - SonarSource . I cannot tell yet when the fix will be released.
Thank you very much for reporting this!
1 Like
ozzi
(Ozzi )
June 23, 2022, 3:58pm
6
Hi Karim
Great, thanks for creating the ticket.
Cheers
system
(system)
Closed
June 30, 2022, 3:58pm
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.