Viewing source code
There are currently 3 ways you can drill down to source code in Sonar:
- Through Measures drill down
- Through Violations drill down
- Through the classes clouds
Though the last one is slightly different in the way it appears (through tabs), the functionality is exactly the same in the three cases.
At the top, some information about the class.
In the middle, 3 tabs representing 3 different views on the code source. At the bottom, the code source contextualized, depending on the chosen tab.
The Sources tab
This tab shows the source code as is, without any comment.
The code coverage tab
The code coverage tab shows the source code annotated with extra informations and colors showing the code coverage.
In the second column, next to each line of code (except empty lines and comment) will appear the number of unit tests that have "hit" the line. If it is 0, the line will be highlighted in red, otherwise the number of hit appears in grees.