As of 7.3, what is the proper way to calculate the COMMENT_LINES_DATA measure?

Hello,

If we look at the API doc (e.g. http://javadocs.sonarsource.org/7.3/apidocs/org/sonar/api/measures/CoreMetrics.html#COMMENT_LINES_DATA) COMMENT_LINES_DATA seems to be deprecated but I cannot find any example or documentation that explains what is the new, proper way to calculate this measure. Can you help, please?

Hi.

I can’t point you to any documentation (because I don’t know if there’s one), but I understand that in newer SonarQube versions it just want to know how many lines contain comments (CoreMetrics.COMMENT_LINES). You don’t need to specify which lines contain comments (the old COMMENT_LINES_DATA metric).

if you set only the COMMENT_LINES metric the values shown in the SonarQube UI will remain the same.

2 Likes

Hi,

Thanks, I’ll use COMMENT_LINES, then.

Regards