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


If we look at the API doc (e.g. 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?


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.



Thanks, I’ll use COMMENT_LINES, then.