SLOC (Source Lines of Code) is the total count of physical lines in a source file, including code, comments, and blank lines. It is the simplest possible size metric.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.
What mehen emits
| Key | Type | Description |
|---|---|---|
loc.sloc | int | Total physical lines in the file. |
loc | int | Alias for loc.sloc. |
How it is computed
mehen counts physical lines in the source bytes — every newline-terminated region is one line. Files that do not end with a newline still count the trailing fragment.When it is useful
- Repository-level dashboards: total SLOC is a coarse but stable size signal.
- Trend reports: SLOC delta is what most engineering organizations track week over week.
- Sanity checking PR size: if a PR adds 5,000 SLOC, that’s worth a comment.
References
- Park, R. E. (1992). Software Size Measurement: A Framework for Counting Source Statements. CMU/SEI-92-TR-20. SEI report.
- Nguyen, V., Deeds-Rubin, S., Tan, T. & Boehm, B. (2007). A SLOC Counting Standard. USC. USC PDF.
- Sonar:
nclocin metric definitions.
See also
- LOC family — overview of all five LOC variants.
- PLOC — instruction lines only.
- LLOC — logical (statement) lines.