-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Sonar Code Quality Testing Essentials
By :

Sonar features a set of metrics to measure project documentation and comments. Before examining documentation rules, it is wise to first discuss and detail these metrics. They are available from the project dashboard within the Comments & Duplications widget, as shown in the following screenshot:
![]() |
Documentation metrics are on the left section of the widget. Click on a metric to get a list of packages/classes and their measured values.
![]() |
Metrics which measure code and documentation size are as follows:
Physical lines: Number of carriage returns
Comment lines: Number of comment lines
Commented-out lines of code: Number of code lines that have been commented out
Lines of code: Number of actual lines of code without counting blank lines, comments, commented-out code, and header file comment used for licensing
Density of comment lines: Number of comment lines with respect to total Lines Of Code
Public undocumented API: Number of public APIs without Javadoc documentation...
Change the font size
Change margin width
Change background colour