# pingcap/tidb SLOC report

> pingcap/tidb: 1,686,894 code lines at commit 17da27f12131, counted with tokei-15.0.0 on 2026-11-24. Saved result 19cc981c9c96da0b6a686afc7b9965783e2d9c0c38c4d90e20fd8d1be1b57374.

Source: [pingcap/tidb on GitHub](https://github.com/pingcap/tidb) · counted commit [17da27f12131](https://github.com/pingcap/tidb/tree/17da27f121311e1af886dbb3bce1f480cfaf22a4)

pingcap/tidb has 1,686,894 source lines of code out of 2,100,984 total lines across 5,172 files, counted with tokei from the master ref at commit 17da27f12131 on November 24, 2026. Tests, docs and generated files are excluded under OctoCounts' canonical public options.

OctoCounts produced this report by resolving pingcap/tidb to commit 17da27f12131, downloading the repository source archive, and counting files selected by the effective rules with tokei, the open-source line counter written in Rust. The table below breaks the count down by programming language into files, total lines, code lines, comment lines, and blank lines, so the figures can be compared across languages and projects. Results are cached by commit, tokei version, and analysis options; an exact reproduction needs the same commit, engine version, and effective counting rules.

## Counting rules and retention

pingcap/tidb: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.

Saved reports remain subject to cache cleanup and replacement. Export the JSON or text for durable citation; live repository URLs can change.

## Repository size insights

This is a very large codebase by counted code lines. Code represents 80.3% of all lines, comments represent 12.0%, and the repository averages 326 code lines per file. Go accounts for 81.9% of counted code.

| Language | Files | Lines | Code | Comments | Blanks |
| --- | ---: | ---: | ---: | ---: | ---: |
| Go | 4,188 | 1,708,319 | 1,382,135 | 174,995 | 151,189 |
| JSON | 177 | 219,627 | 219,502 | 0 | 125 |
| Bazel | 706 | 37,915 | 36,668 | 29 | 1,218 |
| SQL | 9 | 20,055 | 20,053 | 0 | 2 |
| Happy | 2 | 19,656 | 18,743 | 0 | 913 |
| Jsonnet | 5 | 4,546 | 4,081 | 249 | 216 |
| TOML | 12 | 4,647 | 3,338 | 436 | 873 |
| Makefile | 2 | 970 | 769 | 42 | 159 |
| Shell | 19 | 1,104 | 702 | 294 | 108 |
| YAML | 4 | 574 | 469 | 71 | 34 |
| Pan | 2 | 185 | 163 | 0 | 22 |
| SVG | 1 | 110 | 110 | 0 | 0 |
| Dockerfile | 3 | 109 | 59 | 31 | 19 |
| Protocol Buffers | 1 | 83 | 55 | 20 | 8 |
| BASH | 1 | 78 | 47 | 21 | 10 |
| Markdown | 36 | 2,302 | 0 | 1,559 | 743 |
| Plain Text | 4 | 80,704 | 0 | 74,827 | 5,877 |

Top language: Go 81.9%. Generated on November 24, 2026. Canonical report: https://octocounts.com/github/pingcap/tidb/commit/17da27f121311e1af886dbb3bce1f480cfaf22a4?reportId=19cc981c9c96da0b6a686afc7b9965783e2d9c0c38c4d90e20fd8d1be1b57374&analysis=%7B%22profile%22%3A%22default%22%2C%22ignoredDirs%22%3A%5B%5D%2C%22includeDocs%22%3Afalse%2C%22includeTests%22%3Afalse%2C%22ignoredLanguages%22%3A%5B%5D%2C%22includeGenerated%22%3Afalse%7D

## Reproduce this report

[Reproduce this exact report and configuration](https://octocounts.com/github/pingcap/tidb/commit/17da27f121311e1af886dbb3bce1f480cfaf22a4?reportId=19cc981c9c96da0b6a686afc7b9965783e2d9c0c38c4d90e20fd8d1be1b57374&analysis=%7B%22profile%22%3A%22default%22%2C%22ignoredDirs%22%3A%5B%5D%2C%22includeDocs%22%3Afalse%2C%22includeTests%22%3Afalse%2C%22ignoredLanguages%22%3A%5B%5D%2C%22includeGenerated%22%3Afalse%7D).

## Report FAQ

### How many lines of code does pingcap/tidb have?

pingcap/tidb has 1,686,894 lines of code, plus 252,574 comment lines and 161,516 blank lines, for 2,100,984 total lines at commit 17da27f12131 on November 24, 2026. Tests, docs and generated files are excluded under OctoCounts' canonical public options.

### How was the pingcap/tidb line count measured?

OctoCounts resolved the public GitHub repository to commit 17da27f12131, downloaded the source archive, counted it with tokei, and cached the report by commit, tokei version, and analysis options.

### What commit was counted for pingcap/tidb?

This OctoCounts report was generated from master at commit 17da27f12131 on November 24, 2026.

## Similar repository reports

- [vitessio/vitess](https://octocounts.com/github/vitessio/vitess) — Go, 1,668,674 code lines
- [coder/coder](https://octocounts.com/github/coder/coder) — Go, 1,609,936 code lines
- [mudler/LocalAI](https://octocounts.com/github/mudler/LocalAI) — Go, 1,819,123 code lines
- [multica-ai/multica](https://octocounts.com/github/multica-ai/multica) — Go, 1,544,616 code lines
- [OrchestratorInc/agent-orchestrator](https://octocounts.com/github/OrchestratorInc/agent-orchestrator) — Go, 1,544,315 code lines
- [coze-dev/coze-studio](https://octocounts.com/github/coze-dev/coze-studio) — Go, 1,533,916 code lines

## Related OctoCounts pages

- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Largest codebases by programming language](https://octocounts.com/languages)
- [Rust vs Go](https://octocounts.com/compare/rust-vs-go)
- [Deno vs Node.js](https://octocounts.com/compare/deno-vs-node)
- [Kubernetes vs Terraform](https://octocounts.com/compare/kubernetes-vs-terraform)
- [How to count lines of code in a GitHub repository](https://octocounts.com/docs/count-lines-of-code-github)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [OctoCounts API docs](https://octocounts.com/docs/api)
- [All OctoCounts guides](https://octocounts.com/docs)
