Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mehen.ophi.dev/llms.txt

Use this file to discover all available pages before exploring further.

CLOC (Comment Lines of Code) counts lines that contain at least one comment token. Mehen does not distinguish line, block, or doc comments in the headline metric — they all contribute one line per physical line they occupy.

What mehen emits

KeyTypeDescription
loc.clocintComment lines (line + block + doc comments).

How it is computed

A line counts toward CLOC when the parser reports at least one comment trivia token on it. A pure comment line (e.g., a // line in Rust or a # line in Python) counts once. Mixed lines (code followed by an inline comment) count toward both PLOC and CLOC.

When it is useful

  • Comment densitycloc / (cloc + ploc) is a coarse proxy for documentation effort.
  • Generated code detection — heavily generated files often have unusually low or unusually high comment density.
  • Maintainability — the Maintainability Index mi.original variant uses comment count as one of its inputs.
A high CLOC is not automatically a good thing. Stale, copy-pasted, or boilerplate comments hurt maintainability. Read CLOC alongside Cognitive complexity — clear code with few comments often beats opaque code with many.

References

See also