Editing issues in SonarCloud
In SonarCloud, you can change the status of an issue in the following cases (see also Issue life cycle):
- If you want to fix the issue later, you can accept an issue. The issue status is then marked as Accepted.
- If you think the analysis is mistaken, you can mark it as False positive, provided you have the corresponding permission.
In addition, you can reassign an issue, tag an issue, and comment on an issue.
- You can receive an email notification for issue-related events: see Subscribing to email notifications.
- You can manage external issues (issues detected by an external tool and imported into SonarCloud) in the same way as internal issues. Be aware that managing an external issue within SonarCloud has no impact on its state in the external tool. For example, when you mark an issue as False positive in SonarCloud, it is not reflected in the external tool.
- As you edit issues, the related metrics, for example, number of issues taken into account, will update automatically; as will the quality gate status if it's relevant.
Accepting an issue
You may accept an issue if you decide to fix the issue later. Note that SonarCloud ignores accepted issues in the quality reports and ratings of the code.
You can add a comment to your issue change action. See Commenting on an issue below for more information about issue comments.
To accept an issue:
1. Retrieve the issue (it’s not necessary to open the detail view).
2. In the issue card, select the Open issue status and select Accept in the contextual menu as illustrated below. A Status change comment box appears.
3. Enter your change comment (optional) and select Resolve. The issue status is changed to Accepted.
Marking an issue as False positive
If the analysis is mistaken, you can mark an issue as False positive provided you have the Administer Issues permission on the project. Note that SonarCloud ignores False positive issues in the quality reports and ratings of the code.
You can add a comment to your issue change action. See Commenting on an issue below for more information about issue comments.
To mark an issue as False positive:
- Retrieve the issue (it’s not necessary to open the detail view).
- In the issue card, select the Open issue status and select False positive in the contextual menu. A Status change comment box appears.
- Enter your change comment (optional) and select Resolve. The issue status is changed to False positive.
Reopening an issue
You can reopen an Accepted issue (when it’s time to fix it) or a False positive issue (if it turns out to be a true positive).
To reopen one or several issues:
- Retrieve the issue (it’s not necessary to open the detail view).
- In the issue card, select the Accepted or False positive issue status and select Open in the contextual menu. The issue status is reset to Open.
Marking an issue as reviewed
To mark issues as reviewed, you may use the tagging feature: create the Reviewed tag and assign it to reviewed issues: see Tagging an issue below. This way, you can filter the reviewed issues by using the Tag filter.
Assigning an issue
When possible, SonarCloud assigns a default assignee at issue creation time (see Automatic issue assignment for more information). You can assign an unassigned issue to a user, reassign an issue to another user, or unassign an issue.
To assign an issue:
- Retrieve the issue (it’s not necessary to open the detail view).
- In the issue card, click the assignee name or the Not assigned mention. The list of users to whom you can assign the issue appears.
- In the list, select the new assignee (or select Not assigned in the list to unassign the issue).
Tagging an issue
You can create tags and assign them to issues in order to retrieve issues more easily or to indicate a workflow step. For example, you can use a tag to mark an issue as reviewed. The figure below shows how tags are displayed in the issue item.
Rules can also be tagged (In particular, built-in tags may be assigned to some rules.). An issue inherits the tags assigned to the rule that raised the issue. You can remove the inherited tags.
To manage the tags assigned to an issue:
- Retrieve the issue you want to manage.
- In the search results list or in the detail view, select in the Tags section if the issue. A dialog opens with the list of existing tags.
- In the dialog, you can use the search field to search for an existing tag. To create a new tag, enter the new tag in the search field: the new tag will appear in the list of tags with a plus sign in front of it .
- To assign or unassign a tag, select or clear the tag’s checkbox in the list.
- Click anywhere outside the dialog to close the dialog.
Commenting on an issue
When accepting an issue or marking an issue as False positive, you can add a comment. You can also add a comment to an issue anytime. These comments are visible from the Activity tab of the issue: see Viewing the issue management history and comments in Reviewing issues.
By default, comments are shared between all users (it can be disabled at the global level).
To add a comment to an issue:
- Retrieve the issue and open its detail view.
- Open the Activity tab.
- Select Add a comment. The “Add a comment” dialog box opens.
- Enter your comment and select Comment.
- Your comment is added to the Activity tab.
Suppressing the issues on a given line
In most languages, you can use the //NOSONAR
comment at the end of a line to suppress all issues on the line. This will suppress all issues - now and in the future - that might be raised on the line.
Using this comment does not comply with Clean as You Code.
Was this page helpful?