Hi,
I found a memory / performance issue with the HTML rule S5260 (“Table headers should be correctly referenced”).
Context
- Language: HTML
- Rule: S5260
- SonarQube version: tested on Community Build 25.11 and SonarCloud
This came up while I was investigating a failed analysis on a real project. I kept narrowing down the scope (removing files and code) until I arrived at the following minimal HTML that still reproduces the issue:
<table>
<tr>
<td colspan="100000000"></td>
</tr>
</table>
With this file, the analysis allocates a huge number of HashSet / HashMap instances. If I simply remove the colspan attribute, the problem disappears.
From what I can see, the rule seems to model the table structure literally, treating the colspan value as the actual number of columns, which in this case leads to something like 100M columns and proportional data structures.
It would be helpful if the rule capped colspan/rowspan to a reasonable limit, to avoid this kind of worst-case behavior. It also took me some time to find out that the analysis was failing with an OutOfMemoryError because of this specific (wrong) HTML pattern.
Thanks!