What mehen emits
How it is computed
A line counts toward PLOC when the parser reports at least one non-trivia token on it. Lines that hold only whitespace, only block-comment continuation, or only line-comment text are excluded. Mixed lines (code followed by an inline comment) count as PLOC.When it is useful
- “Real code” size: PLOC strips out comments and blanks, so it is closer to what reviewers think of as the size of a file.
- Comparing comment density: pair with CLOC to compute the comment ratio
cloc / (cloc + ploc). - Maintainability inputs: PLOC is one of the inputs to the Maintainability Index.
Equivalents in other tools
References
- Park, R. E. (1992). Software Size Measurement: A Framework for Counting Source Statements. CMU/SEI-92-TR-20. SEI report.
- Sonar:
nclocin metric definitions.
See also
- LOC family — overview.
- CLOC — comment lines.
- LLOC — logical (statement) lines.