Skip to content

Conversation

@valentijnscholten
Copy link
Member

@valentijnscholten valentijnscholten commented Oct 17, 2025

Fixes #12248

The top_ten queries where counting findings from a query that was based on the product table. This led to multiple joins with other tables which led to 1 finding being included multiple times in the counts. The PR changes the queryset to start at the Finding model as that is what we want to count. Some mapping was needed to avoid having to change the metrics templates.

Incorrect from current demo instance:

image

Correct from local instance with fixes:

image

It does mean 1 extra query, but the first/existing query has become much simpler since the amount of joins has been reduced.

Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@rossops rossops merged commit 9975ac5 into DefectDojo:bugfix Oct 20, 2025
150 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Much more finding count in metrics in 'Top 10 Products by bug severity' than expected

5 participants