Few questions regarding Accepted and False Positive status

Hi, I have few questions regarding marking of issues as “Accepted” and “False positive”:

  1. I know I can see a list of the issues that are marked as “Accepted” or “False positive”. I also saw that I can see all of the issues for a specific rule. However, I haven’t find a way to see how many issues were marked as “Accepted” or “False positive” per rule (preferably as a graph, or at least with the ability to sort by count or by %). Is there a way to see that?
  2. I also saw that by looking at a specific issue’s history I can see who changes its status and any comment that they wrote. I would like to see a list of the comments (current ones) for all Accepted (or “False Positive”) issues. Is there a way I can do that?
  3. Can I see a report showing the users that marked the most issues as “Accepted” or “False Positive”?

As far as I could find, Sonar doesn’t provide a reporting or querying module, apart of a REST API. Is that true, or did I missed something?

Hey there.

The short answer here is that anything is possible with the Web API, but we don’t have this kind of reporting available out of the box in SonarQube.

Under the Issues tab of your project, you can filter on status and then check the rules facets.

If you want this data exportable, you would have to query SonarQube with GET api/issues/search using the issueStatuses query parameter and making sure rules is one of the facets requested in your query:

https://next.sonarqube.com/sonarqube/api/issues/search?issueStatuses=ACCEPTED%2CFALSE_POSITIVE&ps=100&facets=rules, which at the bottom will give you details for the top 100 rules.

"facets":[{"property":"rules","values":[{"val":"typescript:S1874","count":2593},{"val":"java:S1874","count":1417},{"val":"java:S5778","count":1009},{"val":"typescript:S109","count":612},{"val":"typescript:S2966","count":249},{"val":"typescript:S4204","count":191},{"val":"java:S5738","count":146},{"val":"java:S1133","count":128},{"val":"java:S4449","count":113},{"val":"java:S3740","count":105},{"val":"java:S107","count":90},{"val":"java:S2259","count":89},{"val":"java:S2333","count":79},{"val":"external_eslint_repo:no-useless-escape","count":60},{"val":"java:S1192","count":53},{"val":"java:S3553","count":50},{"val":"java:S3655","count":49},{"val":"java:S1135","count":48},{"val":"java:S2142","count":42},{"val":"java:S125","count":38},{"val":"java:S119","count":37},{"val":"java:S1612","count":35},{"val":"java:S6126","count":35},{"val":"java:S3776","count":34},{"val":"java:S3008","count":34},{"val":"java:S1075","count":33},{"val":"typescript:S134","count":33},{"val":"external_eslint_repo:local-rules/no-implicit-coercion","count":33},{"val":"java:S2160","count":32},{"val":"java:S1068","count":32},{"val":"java:S1134","count":30},{"val":"java:S1258","count":29},{"val":"typescript:S6819","count":28},{"val":"java:S1948","count":26},{"val":"java:S106","count":25},{"val":"typescript:S1192","count":25},{"val":"java:S2301","count":25},{"val":"java:S1130","count":24},{"val":"java:S1123","count":24},{"val":"typescript:S3776","count":24},{"val":"java:S2925","count":24},{"val":"kubernetes:S117","count":24},{"val":"javaarchitecture:S7091","count":23},{"val":"javaarchitecture:S7027","count":23},{"val":"java:S1181","count":22},{"val":"typescript:S4144","count":21},{"val":"java:S103","count":21},{"val":"java:S1312","count":21},{"val":"java:S139","count":20},{"val":"java:S881","count":19},{"val":"typescript:S6478","count":18},{"val":"typescript:S6594","count":18},{"val":"java:S1128","count":16},{"val":"java:S1172","count":16},{"val":"typescript:S1186","count":16},{"val":"java:S6204","count":16},{"val":"typescript:S6479","count":16},{"val":"typescript:S6644","count":16},{"val":"java:S1711","count":15},{"val":"typescript:S4157","count":15},{"val":"java:S5961","count":15},{"val":"java:S5976","count":15},{"val":"typescript:S6759","count":14},{"val":"java:S1144","count":13},{"val":"java:S138","count":13},{"val":"typescript:S3801","count":13},{"val":"java:S5785","count":12},{"val":"java:S2699","count":12},{"val":"java:S1117","count":11},{"val":"typescript:S4325","count":11},{"val":"typescript:S1135","count":11},{"val":"java:S3457","count":11},{"val":"java:S112","count":11},{"val":"java:S1213","count":10},{"val":"java:S1845","count":10},{"val":"java:S1186","count":10},{"val":"typescript:S3512","count":10},{"val":"java:S2095","count":10},{"val":"java:S2589","count":10},{"val":"java:S2384","count":10},{"val":"java:S135","count":10},{"val":"java:S5977","count":10},{"val":"java:S1820","count":9},{"val":"java:S2093","count":9},{"val":"java:S1104","count":9},{"val":"typescript:S6775","count":9},{"val":"java:S1301","count":8},{"val":"java:S2629","count":8},{"val":"java:S2583","count":8},{"val":"typescript:S4622","count":8},{"val":"typescript:S104","count":8},{"val":"java:S1309","count":8},{"val":"java:NoSonar","count":8},{"val":"typescript:S117","count":8},{"val":"kotlin:S1874","count":8},{"val":"java:S6548","count":8},{"val":"typescript:S6598","count":8},{"val":"kotlin:S6629","count":8},{"val":"typescript:S2301","count":7},{"val":"typescript:S2004","count":7}]}]}

Again, you can use the GET api/issues/search Web API to filter for OPEN/RESOLVED issues and then check each issue for the comments.

            ],
            "comments": [
                {
                    "key": "0522e903-15f7-4c14-84c4-bf760572c403",
                    "login": "colin-mueller-sonarsource@github",
                    "htmlText": "test",
                    "markdown": "test",
                    "updatable": true,
                    "createdAt": "2024-11-27T08:38:32+0000"
                }
            ],

This is trickier, because you’d have to call GET api/issues/changelog for every concerned issue (extracting the key of the issue from GET api/issues/search filtered to your criteria).

I think these are all interesting queries (yes, reporting like this is a pain in SonarQube), and I’ll pass them along to the right PM so we can keep them in mind as we explore the topic of reporting in coming releases.

1 Like

Hi @arnonax-tr ,

Welcome to community and thank you for this feedback! We are exploring what other information we can make available to users at the moment. I have added your suggestions to our internal tracking for discussion.

John

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.