Managing Existing Violations
When going through source code, Sonar in Eclipse will highlight to you existing violations. The idea is that once you have read the code and understood it, the cost of fixing a violation is low.
Fixing a Violation
Go through the Violations view that displays the list of violations of the selected resource (project, file, etc.):
Once a violation has been fixed, you can simply delete it by clicking on the violation icon and then by selecting the Delete violation item. Deleting a violation also removes it from the Violations view:
Creating a Review
If, for any reason you are not going to fix a violation right away but you think it should be resolved, you can create a review on it.
Working through Reviews
It is possible to create custom queries to display reviews in the Task List view:
This Mylyn extension has currently the following limitations that should be quickly fixed:
Checking Code Prior to Commit
When adding or changing the code of an application, Sonar in Eclipse provide the ability to show the quality of this code prior to committing back to the SCM.
This use case is currently not fully supported since Sonar Eclipse does not provide a differential mode yet. It is therefore not possible to differentiate what defect was there before from what has been added by the changes.
Running Local Analysis (Local)
By default Sonar Eclipse takes care to automatically collect information from the Sonar Web server and decorates the source code on-the-fly (remote mode). This default mode is pretty useful as it does not consume any CPU or memory on the developer's computer while quickly displaying valuable quality information as soon as a new source file is opened.