Updated August 15, 2026 · Maintained by huanglizhuo

OctoCounts Methodology

OctoCounts counts public GitHub repository source trees at a pinned ref. It does not clone full git history, does not request account access, and does not analyze private repositories.

What is SLOC?

SLOC, or source lines of code, is a measure of software size counted as the number of lines in a project's source files. A SLOC count normally separates three kinds of line: code lines carrying executable statements or declarations, comment lines carrying documentation, and blank lines. "Lines of code" without qualification usually means the code figure alone, while "total lines" means all three added together. Because the ratio between them varies widely by language and project, a SLOC report is only comparable when the counting rules are stated. OctoCounts reports all three figures separately for every language, counted with tokei at a pinned commit, so any two reports can be compared directly.

Counting Pipeline

  1. Validate: OctoCounts accepts public github.com repository URLs only.
  2. Resolve: The requested branch, tag, or commit SHA is resolved to a pinned commit SHA.
  3. Download: The backend downloads the GitHub source archive for that exact ref.
  4. Extract: The archive is unpacked into a temporary workspace.
  5. Count: tokei detects languages and counts files, total lines, code lines, comments, and blank lines.
  6. Cache: The report is stored by repository, commit SHA, tokei version, and analysis options.

OctoCounts currently runs tokei 14.0.0 (pinned in the backend's Cargo.lock, checked 2026-08-29). Because the cache key includes the tokei version, any report generated after an upgrade is recounted rather than reused, so counts never silently mix results from two tokei versions.

Cache Key

Reports are cached by repository provider, owner, repository name, commit SHA, tokei version, and active analysis options. Repeated requests for the same commit and options return the cached report instead of downloading and counting again.

Default Exclusions

OctoCounts skips heavy dependency and build folders by default so counts represent the source tree rather than installed dependencies or generated output.

.cache
.git
.next
build
dist
node_modules
target
vendor

Metrics

MetricDefinition
FilesFiles detected by tokei as source or supported text formats.
Total linesCode lines + comment lines + blank lines.
Code linesLanguage-parser-recognized source code lines.
CommentsLine and block comments recognized by language rules.
BlanksWhitespace-only lines.
LanguagesDetected programming languages and file types, sorted by code lines.

Limitations

Recommended Citation

As of {date} (commit {sha}), {owner}/{repo} contains {total_lines} total lines: {code_lines} code, {comment_lines} comments, {blank_lines} blank, across {file_count} files in {language_count} languages. Counted with tokei via OctoCounts.

Every cached report page includes its own generated citation text. Prefer citing the canonical report URL, for example https://octocounts.com/github/torvalds/linux.