HTML - Check consecutively for H2 to H6

Using SonarQube 7.9.4 LTS
SonarHTML 3.2

I am using HTML rule Web:NonConsecutiveHeadingCheck which checks consecutively from H1 to H6. However, in my code I am using jspf fragments which get statically included in jsp files and I have H1 present in one of those jspf files.

When I run the scan, it reports finding on every jsp page stating H1 is missing. Since the rule Web:NonConsecutiveHeadingCheck cannot be customized, is there any other quick way to leave out H1 and ensure that page contains heading tags consecutively from H2 to H6 ?

Hi @ankurja,

Thank you for reporting this problem and for your suggestion. Rule Web:NonConsecutiveHeadingCheck will indeed raise False Positive when fragments or templates are used. There is currently no way to prevent this behavior. I would recommend to disable the rule.

Adding a parameter to support consecutive heading tags from H2 to H6 would not work on the long run. There would be false positives as soon as the code is refactored.