Full documentation for SonarQube has moved to a new location: http://docs.sonarqube.org/display/SONAR

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 36 Next »

Table of Contents

 

When drilling down from project dashboard, the resource viewer is the ultimate place to view detailled information on a given resource like a java file or unit tests. The power of the tool comes from the fact that the resources can be viewed according to different axis of quality. On each of the axis a permalink is provided to allow to jump from an external tool or document directly into a resource.

Viewing Source Code

When drilling down into measures, you will eventually reach the file level and will be able to browse the source code.

At the top, 6 tabs representing 6 different views on the code source.

In the middle, a contextualized header depending on the selected tab

At the bottom, the code source contextualized, depending on the chosen tab. A pagination system is in place (3,000 lines) to avoid performance issues on huge files.

It is also possible to view SCM information on this page by using the SCM Activity Plugin

Source Tab

This tab shows source code with highlighted syntax.

Code Coverage Tab

The code coverage tab shows the source code annotated with extra information and colors showing the code coverage. In the first column appears the number of hit of the line during execution of unit tests and in the second one the number of conditions covered on the line along with the number of conditions to cover.



A drop down list enables to filter the information to show on the viewer

When code coverage by integration tests is collected with help of Jacoco, all IT coverage measures are displayed in this "Coverage" tab :

Violations Tab

The violations tab shows the source code annotated with extra informations and colors showing the coding rules violations. By default, only the code immediately next to the violation is shown.



A drop down list enables to filter on a specific violation or on a specific priority.

Duplications Tab

The duplications tab shows every duplicated chunk of code within a class and the name of the other class it is duplicated with.

Dependencies Tab

The Dependencies tab shows all incoming and outgoing dependencies on the chosen file.

LCOM4 Tab

The LCOM4 tab shows blocks of resources within a class that have tight relationship. Having more that one block here probably means that the class is assuming more than one responsibility.

Viewing Unit Tests

When drilling down into unit tests measures (except the code coverage), you will eventually reach the unit test class level.

 

 

Sources Tab

This tab simply displays the source code of your unit test class:

Tests Tab

This tab displays the result of the unit tests belonging to the unit tests class.

In case the test failed or was in error, the reason of the issue can be viewed.

Violations Tab

This tab displays the violations on the unit tests.

 

 

  • No labels