Skip to content

Duplicate fingerprints in checkstyle reports #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vincent-hennig opened this issue Jan 30, 2025 · 3 comments
Open

Duplicate fingerprints in checkstyle reports #8

vincent-hennig opened this issue Jan 30, 2025 · 3 comments

Comments

@vincent-hennig
Copy link

Hi - Thanks for making this plugin!
When I tested it on a project, I noticed that Gitlab was showing fewer findings than were actually in the checkstyle report. I believe the reason is that the code quality plugin was generating many duplicate fingerprints which Gitlab is expecting to be unique.
Looking at the CheckstyleFindingsProvider, i believe that this happens when two findings share the same file path, severity, message text and column index which seems to be more common than one would expect. In my case it happened 17 times within one small project, leading to 17 unreported findings on the Gitlab UI.

Thanks again and let me know if you need any further information!

@chkal
Copy link
Owner

chkal commented Feb 23, 2025

Hi @vincent-hennig. Sorry for the delayed response.

Yes, I guess you could be correct. GitLab is expected unique fingerprints but unfortunately Checkstyle doesn't provide such fingerprints by default (Findbugs does by the way). Therefore, I was forced to create fingerprints by myself as part of the plugin. Unfortunately this isn't easy to do. I ended up using the implementation you mentioned above which doesn't take the row number into account. I guess this is the reason for the issues you are running into.

The big question is: Do you have any better idea for creating such fingerprints that doesn't suffer from this issue? I would be happy to hear your thoughts.

Christian

@vincent-hennig
Copy link
Author

Hey @chkal
It depends a bit on the requirements for these fingerprints. If they have to be identical across multiple pipeline runs then that makes it more difficult. Otherwise a UUID should be enough to solve the issue.

@chkal
Copy link
Owner

chkal commented Feb 25, 2025

@vincent-hennig The need to be identical between pipeline runs. AFAIK GitLab uses these fingerprints to determine if a findings is new, was fixed or is still there. So if a fingerprint was not present in the previous run but shows up in the current run, this is a "new finding". If it was present in the previous run but not in the current anymore, that is a "fixed finding", etc.

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

No branches or pull requests

2 participants