HTML
Language-specific information about the way that SonarQube Cloud supports the analysis of HTML.
Last updated
Was this helpful?
Language-specific information about the way that SonarQube Cloud supports the analysis of HTML.
To discover and update the HTML-specific properties, navigate in SonarQube Cloud to Your Project > Administration > General Settings > Languages > HTML. See Configuration overview for more information about setting properties.
The HTML analyzer does not analyze JavaScript, TypeScript, or CSS embedded in <script> and <style> tags. That analysis is handled by the JavaScript/TypeScript analyzer, which only looks inside files with the .html, .htm, or .xhtml extension, a narrower list than the file extensions the HTML analyzer itself recognizes. See JavaScript/TypeScript/CSS for the properties that control this behavior.
PHP and HTML analyzers both analyze files with extensions: .php, .php3, .php4, .php5, .phtml.
File metrics, such as the number of lines of code, can only be measured by one of the languages, PHP or HTML. They are handled by the PHP analyzer by default, and by HTML analyzer if for some reason the former is not present.
The HTML analyzer inspects PHP files even if the PHP file extensions are not included in the list of file extensions to analyze.
Adding the //NOSONAR comment at the end of the line will suppress all issues on that line.
Rather than relying on this method, we suggest refining your analysis scope to avoid creating major gaps in your code review. Because the NOSONAR comment silences all current and future issues on a line without regard for their severity, it is an imprecise tool. Even if you only intend to hide a minor stylistic point, you could unintentionally obscure a serious security flaw.
Last updated
Was this helpful?
Was this helpful?

