Web:S5254 "<html>" element should have a language attribute

Template for a good false-positive report, formatted with Markdown:

  • versions used: SonarQube Version 8.8 (build 42792)
  • minimal code sample: <html <?php language_attributes(); ?>>.

language_attributes() is the default WordPress function to supply the language attribute.
having language_attributes() in the html tag should suppress Web:S5254

Hallo @mmu69,

Thanks for your report. Indeed, this is a valid function call to supply the language attribute.
We will adjust the rule to take such function calls into account.

I’ve created a ticket, so you can stay up to date about the progress of the modification.