Need to assign bugs to actual code committer

We are using the git plugin to merge the code and Azure side CI/CD.
Our practice is like a developer did a code change and raise a pull request and assign it to the reviewer. Once the reviewer finds the code good he merges the code to the master branch after which the auto-deployment and sonarqube check happen.

Now if there is any bug in code then always the reviewer name is appearing in code at sonarqube bug window as he was the person who had committed the code finally to the master branch.
Is there any way we can get the person name who has raised the PR and actually did the code change?
Let me know if you think our practice is not as per the recommendations by sonarqube.

Hey there –

SonarQube is just reading the information from Git. If your process results in the reviewer being marked as the committer, rather than the author… your issue is not with SonarQube (nor is it something we could address), but with Git/Azure Devops. You can imagine there’s no heuristic that would let SonarQube know that somebody else should be the author, if Git isn’t saying so.

Is the reviewer making changes to the code? Quite honestly, I’m not sure what other way you would end up with the reviewer marked as the committer in Git (but maybe I’m missing something in Azure Devops)