Skip to content

The CppCheck parser should retain the order of violations#195

Merged
tomasbjerre merged 1 commit intotomasbjerre:masterfrom
uhafner:order-cppcheck-locations
Nov 15, 2025
Merged

The CppCheck parser should retain the order of violations#195
tomasbjerre merged 1 commit intotomasbjerre:masterfrom
uhafner:order-cppcheck-locations

Conversation

@uhafner
Copy link
Contributor

@uhafner uhafner commented Nov 14, 2025

The CppCheck parser handles individual locations of a warning as separate violations. These violations are then returned to the caller as a sorted set, destroying the insertion order. To visualize the affected locations in the original order, we need to store the insertion order by adding a new property.

See JENKINS-75217

Note: I first tried to replace the TreeSet with a LinkedHashSet but this will destroy the ordering for all your parsers...

The CppCheck parser handels individual locations of a warning as separate violations.
These violations are then returned to the caller as a sorted set, destroying the insertion order.
To visualize the affected locations in the original order, we need to store the insertion order
by adding a new property.

See https://issues.jenkins.io/browse/JENKINS-75217
@uhafner uhafner force-pushed the order-cppcheck-locations branch from b2c7d20 to f7b7216 Compare November 14, 2025 22:20
@tomasbjerre tomasbjerre merged commit c42bc13 into tomasbjerre:master Nov 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants