Professional Documents
Culture Documents
Sonar Eclipse provides a comprehensive Sonar integration for Eclipse. The objective of this Eclipse plugin is that developers do not have to leave their favorite IDE to get valuable information on code quality. Most of the information displayed in the Sonar Web interface is now available in Eclipse. Installing Sonar Eclipse is pretty simple. For instructions, prerequisites and a demonstration video go to Installing Sonar Eclipse.
Table of content
Features
Get quality measures on ressource (project, package and files) Get hotspots on given metrics (files with most duplicated lines, most complex files...) Displays markers on source code upon violation of a coding standard Get comprehensive list of violations on a resource Bridge to Sonar Web server for access additional services (clouds, treemap...) Remote or local mode
You are now all done with configuration and can start using Sonar Eclipse.
In some cases the eclipse project may not be automatically associated to a Sonar project. If that happens, you need to manually enter the groupId and the artifactId of the Sonar project. For instance for the following Sonar project http://nemo.sonarsource.org/dashboard/index/org.codehaus.sonar-plugins:sonar-flex-plugin, the groupId is "org.codehaus.sonar-plugins" and the artifactId is "sonar-flex-plugin".
Measures view
The Measures view allows to gather all available measures on the selected ressource. Most of the time, developers focus their attention on only a few metrics like complexity, uncovered lines of code by unit tests, duplicated lines, ... and want to get a quick overview on those metrics. That's why favourite metrics are displayed on the top of the Measures view. Adding or Removing a metric from the favourites list is possible by right clicking on the metric name :
Violations view
The Violations view displays the list of violations to quality rules for the selected ressource :
A double-click on a violation opens the source code editor and highlights the violation :
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 :
Hotspots view
The Hotspots view allows to quickly identify hotspots on files according to favourite metrics (defined in the Measures view). You can for instance look at files with the greatest number of duplicated lines, greatest number of violations, greatest number of uncovered lines by unit tests...
Web view
The Web view displays the web Sonar dashboard (for projects and packages) or the web Sonar ressource viewer (for files). This web page can be used to access information and services (cloud, treemap, ...) that are not yet natively available in Sonar Eclipse :
Later, at any time, you can run a new local analysis by choosing "Configure -> Sonar -> Run Local Analysis.