Code analysis includes comments within source code lines?

Avatar

Aleksander M.

about 1 year ago

When counting the number of lines with comments, do you include those comments included at the end of lines with source code? Or just those lines that are purely comments? Would be a good idea to do, if not being done already.


Avatar

Robin Luckey

about 1 year ago

A line with mixed code and comment counts only as code.

To be counted as a comment line, the line must contain purely comments.


Avatar

Aleksander M.

about 1 year ago

Yes, that was my first impression. Is there any plan to change this?


Avatar

gwoo

about 1 year ago

I would consider this a pretty low priority. Of course you are always free to fix it since the ohcount is available at labs.ohloh.net.

In reality, ohcount is correct that the mixed line is code and clearly the comment is not all that important. A comment that is meant to influence the documentation of the code should not be mixed with the code. Ohcount makes some value judgements here and there is really nothing wrong with that.