The measure of "Comments" is not very correct


(WANGLUO) #1

Template for a good bug report, formatted with Markdown:

  • SonarQube6.7.3
  • i got a file measure like this
    "Lines 596
    Lines of Code 457
    Comments 10.9% / 56 "
    the file "Comments " is 56 line,bug some one are in “Lines of Code”
    but the Comments rate is 10.9% =56/(56+457)

Is my description clear?


(G Ann Campbell) #2

Hi,

What language(s) are we talking about?

 
Ann


(WANGLUO) #3

it’s JAVA

if the code line is

i++; //comments

how to count “Lines of Code” and “Comments”?
thanks for your replay!


(G Ann Campbell) #4

Hi,

From my tests, this:


class C {
    
    int i;  // comment    
    
}

Registers as 3 LoC and 1 comment line.

 
Ann