False positive with rule "All HTML tags should be closed" on cshtml

SonarQube version :
Language analyser : [SonarHTML]


We have a rule that returns a false positive on .cshtml when the model used in the page is a generic type like List<Namespace.Model>. The rule complains about <Namespace.Model> having no closing tag even if it is not an html tag. I think lines beginning with @ in a cshtml file should be ignored by this rule.

Here is an example:

@model List<Namespace.Model>
<div class="tab-pane fade active show" id="demandes" role="tabpanel" aria-labelledby="tabDemande">
    <div class="row">
        <div class="col-12 justify-content-between pl-4 ">
            <data-grid Id="tableauDemandes" Items="@Model"></data-grid>                  



Thank you for reporting this! I created a ticket to handle it https://jira.sonarsource.com/browse/SONARHTML-119

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.