//、#)与块注释(/* */、三引号),依语言规则判定。//、/* 不应被误判为注释。Count total, code, blank and comment lines in a snippet, and see the share each one takes.
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Physical lines | all lines split by newline, including blanks and comments | SLOC counting conventions |
| Logical lines | SLOC counts statements; continuations merge | SLOC counting conventions |
| Comment ratio | comment lines / total lines as a maintainability signal | SLOC counting conventions |