# How to find defects injected user (person who violated quality gate condition) in SonarQube

**URL:** <https://community.sonarsource.com/t/how-to-find-defects-injected-user-person-who-violated-quality-gate-condition-in-sonarqube/68180>\
**Category:** SonarQube Server / Community Build\
**Tags:** coverage\
**Created:** [July 18, 2022, 1:10pm UTC](https://community.sonarsource.com/t/how-to-find-defects-injected-user-person-who-violated-quality-gate-condition-in-sonarqube/68180 "2022-07-18T13:10:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasun](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@kasun](https://community.sonarsource.com/u/kasun)\
**Post date:** [July 18, 2022, 1:10pm UTC](https://community.sonarsource.com/t/how-to-find-defects-injected-user-person-who-violated-quality-gate-condition-in-sonarqube/68180/1 "2022-07-18T13:10:09Z")

</div>

I have configured SonarQube with quality gate metrics with Code smell, Vulnerabilities, Bugs, Code coverage and etc.

When someone committed the code to git, I want to find who violates the quality gate condition, I mean who injected a buggy code to the git.

In jenkis I can get the last commit user, but that is not practical always because if there are 2 users and first user commits with bugs and second user commit again with quality code and push it to the git. Then the second user is not the person who responsible for violating the quality gate condition.

I tried generating CNES report as described in here. [GitHub - cnescatlab/sonar-cnes-report: Generates analysis reports from SonarQube web API.](https://github.com/cnescatlab/sonar-cnes-report)

This works fine. But in my case because of the version miss matches and other unavoidable dependencies this method is not applicable for me.

I am asking this question to know is there any other methods to get the commit user who violated the quality gate condition. I tried to find any other working method, but I couldn’t up to now.

Sonaqube version - 7.1.0.11001 ( cannot update due to other dependencies )

If someone with similar experience, please answer to this. Thanks in advance for your attention.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [July 18, 2022, 1:12pm UTC](https://community.sonarsource.com/t/how-to-find-defects-injected-user-person-who-violated-quality-gate-condition-in-sonarqube/68180/2 "2022-07-18T13:12:25Z")

</div>

Hey there.

Please don’t raise duplicate threads.

> [@How to get the git commit author, Who violate the SonaQube quality gate metric condition](https://community.sonarsource.com/t/how-to-get-the-git-commit-author-who-violate-the-sonaqube-quality-gate-metric-condition/67679):
>
> I am using Sonaqube version - 7.1.0.11001 I want to find who injected bugs/vulnerabilities or any other quality gate metric condition violation to the code. I tried generating “CNES Report” for finding this. (sonar-cnes-report-3.2.2.jar) But when I generated report as an Ms Exel sheet, the author field is empty in the report. So what is the issue here, or is there any method to get the git commit author(git username) who injected the code with metric violations? Thanks in advance…!

I will close this one.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [July 18, 2022, 1:12pm UTC](https://community.sonarsource.com/t/how-to-find-defects-injected-user-person-who-violated-quality-gate-condition-in-sonarqube/68180/3 "2022-07-18T13:12:29Z")

</div>


