Refactor the security report mutations
This is already done in !9443 (closed) but we needed an issue to track it properly.
The security reports mutations have a lot of repeated code. This aims to fix some ~"technical debt" by making re-usable utilities and applying them to the mutations.
Note: The linked 9334 MR was a typo
Edited by Fabio Busatto