Total fixed Issues

sonarqube

(Fanny Tan) #1

Hello,

I have list of projects which has been scanned by Sonar. My manager want to know how many issues has been fixed in each project in a graphic. Example picture:

I can view project which has fixed number of issues and project which has not fixed their issues but add more issues instead in this picture. Is there a way to get this kind of chart for report?

Notes: These charts including removed resolution which it should not


(G Ann Campbell) #2

Hi,

As you’ve probably figured out, this graph is not available in SonarQube. What’s available instead is a series of bubble charts showing Risk, Reliability, &etc

Projects%20-%20Google%20Chrome_101

More generally, what we make very visible is the QG status, because that’s what we really feel you should be paying attention to

Selection_102

And if the concern is really which projects are adding issues, this is the way to go: set up a default Quality Gate that’s focused on New Code. In fact, the Built-in Sonar way Quality Profile focuses exclusively on New Code

Selection_103

And if you have a Quality Gate that focuses on new code, then you don’t really need fancy graphs to know which projects are doing well, you just look at which ones are releasable (passing the Quality Gate) and which ones aren’t.

With regard to fixing old issues, here’s why we feel that’s not really where the emphasis should be: https://docs.sonarqube.org/display/SONAR/Fixing+the+Water+Leak

 
HTH,
Ann


(Fanny Tan) #3

@ganncamp

Hi thank you for your reply, I really appreciate that. I want to explain what my manager needs more clear (since I think I didn’t explain it well)

Actually what my manager what to know is :

  1. how many issues can be fixed by each projects within particular time, for example one month
  2. from fixed issues, how many bugs, vulnerability and code smells has been fixed.

At first I view activity to view is it going up or down and calculate the value manually to decide how many bugs has been fixed. then I realised there is removed and fixed type, so this solution is not precise. So I can not answer the first question yet.

Next, I have to manually view Issues tab on each project with Resolution Fixed to answer the second question of my manager. And we have quite a lot big projects and small projects, so it is quite taking a lot of time.

Is there a better way to answer these question?

thank you @ganncamp


(G Ann Campbell) #4

Hi,

Let me first differentiate between Removed and Fixed: Issues go to Removed only when

  • The rule is Removed from the profile (so not actually fixed, just ignored)
  • The file is Removed from analysis (e.g. via exclusions)

If your manager really insists on this, you’ll want to set up an automated process which pulls the data using Web Services.

 
Ann


(Fanny Tan) #5

Hi, thank you. I will try to view Sonar API and make a report from it. :smile:


(Fanny Tan) #6

Hi @ganncamp

What about fixed? If I fix it directly on my code, statuse will be “Fixed”.
But, is there other criteria to make issues “Fixed”?
Because I got a project with more than 3000 fixed issues and my manager ask me if there are any criteria from Sonar to make issues “Fixed”


(G Ann Campbell) #7

Hi,

“Fixed” means the code was changed so the issue no longer exists.

 
Ann


(Fanny Tan) #8

Hi @ganncamp

I have tried to create report but It seems I got a new problem about the value.

I want to know total fixed issues each month and week in each projects.
Right now, I am looking total fixed from creation date, but I realized it is not working since it shows creation date not fixed date.

I create bugs on October, then I fixed it on November, to know wether it has been fixed or not and when I should look at October month and check the history.

Is there any way I can create this report?

Thank you.


(G Ann Campbell) #9

Hi,

There’s no search parameter for closed or even updated date. Also, closed issues are purged on a regular basis. You’re really not going to be able to report on close volume accurately.

 
Ann


(Fanny Tan) #10

Thanks @ganncamp for answering.

I think I found a solution, but I am not quite sure since I don’t know how accurate it is. I will use API from Sonar: GET api/issues/search
with parameter :
componentKeys = projectKey ,
resolutions = FIXED,
types = BUGS,CODE_SMELL, VULNERABILITY,
s = CLOSE_DATE

This API will shows total fixed issues and I will group by the issues based on close_date. Therefore, I will get fixed issues based on close_date (which I assume as closed issues date,is it correct?)

What do you think?


(G Ann Campbell) #11

Hi,

Good catch! I missed that when I glanced through the docs for my earlier answer. And I’ve just double-checked the response, and closeDate is part of it. So it looks like you’ll be able to do this after all! Sorry I steered you wrong before.

 
:slight_smile:
Ann


(Fanny Tan) #12

Okay, thank you. It is okay, nothing is wrong. I was too focused on the web application and just realized that there is API provide the information.

Anyway, thank you for helping me :smile: