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.

The Lines of Code (LOC) family is the simplest size metric mehen reports — and one of the oldest. A single number is misleading, so mehen separates physical lines, instruction lines, statements, comments, and blanks.

What mehen emits

KeyPageCounts
loc.slocSLOCEvery physical line, including comments and blanks.
loc.plocPLOCPhysical instruction lines (excludes comments and blanks).
loc.llocLLOCLogical lines — statements per the language’s grammar.
loc.clocCLOCComment lines (line, block, and doc comments).
loc.blankBlankWhitespace-only lines.
locAlias for loc.sloc.

Worked example

/*
Instruction: Implement factorial function
For extra credits, do not use mutable state or imperative loops.
 */

/// Factorial: n! = n*(n-1)*(n-2)*...*3*2*1
fn factorial(num: u64) -> u64 {

    // use `product` on `Iterator`
    (1..=num).product()
}
MetricValue
loc.sloc11
loc.ploc3
loc.lloc1
loc.cloc6
loc.blank2

Why split the count

The LOC family separates concerns that “lines of code” conflates:
  • SLOC is the simplest size signal — useful for repository-level dashboards.
  • PLOC removes whitespace and comments and is closest to “real code”.
  • LLOC counts statements, so it is the right axis for comparing language idioms (one Python comprehension vs. a multi-line Rust loop).
  • CLOC and Blank are reported separately because comment and whitespace ratios are themselves signals of style and readability.

References

  • Park, R. E. (1992). Software Size Measurement: A Framework for Counting Source Statements. CMU/SEI-92-TR-20, Software Engineering Institute, Carnegie Mellon. SEI report — the standard reference for what does and does not count as a “line”.
  • Nguyen, V., Deeds-Rubin, S., Tan, T. & Boehm, B. (2007). A SLOC Counting Standard. USC Center for Systems and Software Engineering Technical Report. USC PDF.
  • Sonar: Lines of code in metric definitions.

See also