A line counter can be perfectly consistent and still answer a narrower question than its headline suggests. SourceTally defines a physical line as text terminated by LF, CRLF, or CR, plus a final unterminated segment. It separately marks whitespace-only lines. That rule is reproducible across ordinary UTF-8-compatible files, but it does not identify statements, executable paths, declarations, comments, generated code, or business value.

Physical lines describe layout

One compact statement may occupy one line or twenty lines after formatting. A minified bundle may contain a large amount of behavior on one physical line. Conversely, documentation, configuration, test fixtures, generated clients, and data files can add many lines without adding application logic. Use physical totals to inventory a snapshot, not to rank engineering ability.

Logical SLOC needs a grammar

A logical source line usually tries to count language constructs rather than visual rows. Semicolons, significant indentation, multiline expressions, macros, templates, embedded languages, strings, and preprocessor branches make that definition language-specific. SourceTally does not pretend that splitting text or matching punctuation can produce one authoritative logical count across dozens of languages.

Comments require lexical context

The same characters may start a comment, occur inside a string, appear in a regular expression, or belong to another embedded language. Block comments can cross chunks and lines. Documentation comments may be source, API documentation, or both. A reliable code/comment split needs reviewed lexers and explicit policies, so the first release reports only total, blank, and non-empty physical lines.

Compare only like-for-like runs

Record the commit or local snapshot, exclusions, failed files, encoding boundary, generated-file choice, and tool version. A difference is meaningful only when those conditions match. Even then, more lines may reflect tests, safer validation, clearer documentation, generated interfaces, or duplication. Treat the number as a navigational signal that prompts inspection, never as a standalone performance target.