SonarSource Rules
  • Products

    In-IDE

    Code Quality and Security in your IDE with SonarQube Ide

    IDE extension that lets you fix coding issues before they exist!

    Discover SonarQube for IDE

    SaaS

    Code Quality and Security in the cloud with SonarQube Cloud

    Setup is effortless and analysis is automatic for most languages

    Discover SonarQube Cloud

    Self-Hosted

    Code Quality and Security Self-Hosted with SonarQube Server

    Fast, accurate analysis; enterprise scalability

    Discover SonarQube Server
  • SecretsSecrets
  • ABAPABAP
  • AnsibleAnsible
  • ApexApex
  • AzureResourceManagerAzureResourceManager
  • CC
  • C#C#
  • C++C++
  • CloudFormationCloudFormation
  • COBOLCOBOL
  • CSSCSS
  • DartDart
  • DockerDocker
  • FlexFlex
  • GitHub ActionsGitHub Actions
  • GoGo
  • HTMLHTML
  • JavaJava
  • JavaScriptJavaScript
  • JSONJSON
  • JCLJCL
  • KotlinKotlin
  • KubernetesKubernetes
  • Objective CObjective C
  • PHPPHP
  • PL/IPL/I
  • PL/SQLPL/SQL
  • PythonPython
  • RPGRPG
  • RubyRuby
  • RustRust
  • ScalaScala
  • ShellShell
  • SwiftSwift
  • TerraformTerraform
  • TextText
  • TypeScriptTypeScript
  • T-SQLT-SQL
  • VB.NETVB.NET
  • VB6VB6
  • XMLXML
  • YAMLYAML
HTML

HTML static code analysis

Unique rules to find Bugs, Security Hotspots, and Code Smells in your HTML code

  • All rules 83
  • Bug23
  • Security Hotspot3
  • Code Smell57
 
Tags
    Impact
      Clean code attribute
        1. Label elements should have a text label and an associated control

           Code Smell
        2. Elements with an interactive role should support focus

           Code Smell
        3. Images should have a non-redundant alternate description

           Code Smell
        4. Heading elements should have accessible content

           Code Smell
        5. Non-interactive DOM elements should not have an interactive handler

           Code Smell
        6. Non-interactive elements shouldn't have event handlers

           Code Smell
        7. DOM elements should not use the "accesskey" property

           Code Smell
        8. Non-interactive DOM elements should not have the `tabIndex` property

           Code Smell
        9. Anchor tags should not be used as buttons

           Code Smell
        10. Interactive DOM elements should not have non-interactive ARIA roles

           Code Smell
        11. Non-interactive DOM elements should not have interactive ARIA roles

           Code Smell
        12. "tabIndex" values should be 0 or -1

           Code Smell
        13. DOM elements should use the "autocomplete" attribute correctly

           Code Smell
        14. Anchors should contain accessible content

           Code Smell
        15. Focusable elements should not have "aria-hidden" attribute

           Code Smell
        16. DOM elements with the `aria-activedescendant` property should be accessible via the tab key

           Code Smell
        17. ARIA properties in DOM elements should have valid values

           Code Smell
        18. Using remote artifacts without integrity checks is security-sensitive

           Security Hotspot
        19. "<object>" tags should provide an alternative content

           Code Smell
        20. Table cells should reference their headers

           Bug
        21. Tables used for layout should not include semantic markup

           Bug
        22. HTML "<table>" should not be used for layout purposes

           Code Smell
        23. Tables should have headers

           Bug
        24. "aria-label" or "aria-labelledby" attributes should be used to differentiate similar elements

           Code Smell
        25. "<html>" element should have a language attribute

           Bug
        26. Disabling auto-escaping in template engines is security-sensitive

           Security Hotspot
        27. Authorizing an opened window to access back to the originating window is security-sensitive

           Security Hotspot
        28. <script>...</script> elements should not be nested

           Bug
        29. Videos should have subtitles

           Code Smell
        30. Track presence of forbidden parent element

           Code Smell
        31. Dynamic includes should not be used

           Code Smell
        32. Track uses of disallowed elements

           Code Smell
        33. The "style" attribute should not be used

           Code Smell
        34. Track uses of disallowed attributes

           Code Smell
        35. Track lack of required child elements

           Code Smell
        36. Some Java packages or classes should not be used in JSP files

           Code Smell
        37. Track uses of disallowed child elements

           Code Smell
        38. Multiple "page" directives should not be used

           Code Smell
        39. White space should be used in JSP/JSF tags

           Code Smell
        40. Disallowed "taglibs" should not be used

           Code Smell
        41. Track lack of required attributes

           Code Smell
        42. Labels should be defined in the resource bundle

           Bug
        43. Track lack of required parent elements

           Code Smell
        44. Files should not be too complex

           Code Smell
        45. HTML comments should be removed

           Code Smell
        46. Web pages should not contain absolute URIs

           Code Smell
        47. Attributes deprecated in HTML5 should not be used

           Code Smell
        48. JSP expressions should not be used

           Code Smell
        49. All HTML tags should be closed

           Bug
        50. Attributes should be quoted using double quotes rather than single ones

           Code Smell
        51. JavaScript scriptlets should not have too many lines of code

           Code Smell
        52. Track lack of copyright and license headers

           Code Smell
        53. Track lack of required an element with the required "id"

           Code Smell
        54. JSF expressions should be syntactically valid

           Bug
        55. Track uses of disallowed namespaces in XHTML documents

           Code Smell
        56. Sections of code should not be commented out

           Code Smell
        57. Track uses of "TODO" tags

           Code Smell