Ruby HTML views partials <li> issues

SonarQube - 8.9.6
Scanner - 4.6.2.2472

Shows false bugs for partials having <li> tags and asks to enclose with <ul> tags. <ul> tags are already added in parent html file.

Example:-
app/view/index.html.erb - with <ul> tag and call partial list.html.erb
app/view/shared/list.html.erb - with <li> tag

Hi Jaspreet,

To fix the rule we need to identify it. I think you are talking about the rule Web:ItemTagNotWithinContainerTagCheck . Could you confirm?

If I understand correctly, you have some <li> tags in list.html.erb that are reported as issues. But the issues are false positives because the <li> tags are at the root level in the list.html.erb file, and the list.html.erb file is correctly included in another file inside <ul> tags. Could you confirm?

yes, correct.

Hey @jaspreet_singh ,

thank you for sharing this with us. This is indeed a false positive.

We have a ticket to track and solve this kind of problem with this rule: [SONARHTML-159] - Jira . We’ll try to get this into the next version to be released.