Fast key-value DB in Go.
This report summarizes scanner evidence for dgraph-io/badger, a Go project with 15,796 GitHub stars. SynthScan examined 43,662 lines of code across 148 source files, recording 67 pattern matches distributed across 6 syntactic categories. The legacy adjusted pattern signal is 1.9 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 67 finding(s).
Are imports declared and package/API names verified? 0 finding(s).
Are wrappers, guards, and repeated structures necessary? 0 finding(s).
Which changes need focused human review? 67 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 67 distinct pattern matches across 6 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | l0_blockwrites_regression_test.go | 21 | // TestDropPrepareDrainDoesNotDropWrites is a regression guard for Badger #2308. | COMMENT |
| LOW | l0_blockwrites_regression_test.go | 41 | // This test reconstructs that exact condition deterministically: flush goroutine | COMMENT |
| LOW | stream_writer.go | 21 | COMMENT | |
| LOW | backup.go | 21 | ) | COMMENT |
| LOW | db.go | 1061 | db.mt, err = db.newMemTable() | COMMENT |
| LOW | db.go | 1261 | // RunValueLogGC triggers a value log garbage collection. | COMMENT |
| LOW | db.go | 1281 | // called. | COMMENT |
| LOW | db.go | 1781 | } | COMMENT |
| LOW | db.go | 1841 | db.lc.nextFileID.Store(1) | COMMENT |
| LOW | db2_test.go | 641 | require.NoError(t, db2.Close()) | COMMENT |
| LOW | options.go | 201 | maxValueThreshold = (1 << 20) // 1 MB | COMMENT |
| LOW | options.go | 281 | return superflag | COMMENT |
| LOW | options.go | 361 | // | COMMENT |
| LOW | options.go | 401 | COMMENT | |
| LOW | options.go | 461 | // WithLevelSizeMultiplier returns a new Options value with LevelSizeMultiplier set to the given | COMMENT |
| LOW | options.go | 481 | return opt | COMMENT |
| LOW | options.go | 501 | // VLogPercentile with value 0.99 means 99 percentile of value will be put in LSM tree | COMMENT |
| LOW | options.go | 521 | } | COMMENT |
| LOW | options.go | 661 | // WithChecksumVerificationMode returns a new Options value with ChecksumVerificationMode set to | COMMENT |
| LOW | options.go | 701 | // have better performance and higher levels have better compression ratios. | COMMENT |
| LOW | options.go | 721 | // set to the given value. | COMMENT |
| LOW | options.go | 741 | // Zero value for IndexCacheSize means all the indices will be kept in | COMMENT |
| LOW | value_test.go | 1361 | } | COMMENT |
| LOW | stream.go | 41 | // Number of goroutines to use for iterating over key ranges. Defaults to 8. | COMMENT |
| LOW | stream.go | 61 | MaxSize uint64 | COMMENT |
| LOW | iterator_test.go | 301 | require.NoError(t, db.View(func(txn *Txn) error { | COMMENT |
| LOW | iterator_test.go | 321 | // | COMMENT |
| LOW | util.go | 61 | // // debugPrintMore shows key ranges of each level. | COMMENT |
| LOW | txn.go | 401 | // The current transaction keeps a reference to the key and val byte slice | COMMENT |
| LOW | txn.go | 621 | // In that case, commitTs should not be never be zero. This might happen if | COMMENT |
| LOW | txn.go | 641 | // 5. If callback is provided, Badger will return immediately after checking | COMMENT |
| LOW | txn.go | 741 | // | COMMENT |
| LOW | iterator.go | 61 | // KeyCopy returns a copy of the key of the item, writing it to dst slice. | COMMENT |
| LOW | iterator.go | 441 | // ThreadId is an optional value that can be set to identify which goroutine created | COMMENT |
| LOW | level_handler.go | 21 | // For level >= 1, tables are sorted by key ranges, which do not overlap. | COMMENT |
| LOW | l0_backpressure_test.go | 241 | // broadcast on close. Many concurrent writers hammer the DB so the write path | COMMENT |
| LOW | l0_backpressure_test.go | 261 | // -count iterations. Run with -race and a high -count. NOTE: this is probabilistic | COMMENT |
| LOW | levels.go | 261 | } | COMMENT |
| LOW | levels.go | 381 | // 1. The desired base level is the deepest level whose target size is still within | COMMENT |
| LOW | levels.go | 681 | return false | COMMENT |
| LOW | levels.go | 821 | if version <= discardTs && vs.Meta&bitMergeEntry == 0 { | COMMENT |
| LOW | levels.go | 1181 | // L0 in parallel would require partitioning L0->Lbase by key range (e.g. reusing | COMMENT |
| LOW | levels.go | 1681 | for l0.numTablesLocked() >= s.kv.opt.NumLevelZeroTablesStall { | COMMENT |
| LOW | value.go | 261 | } | COMMENT |
| LOW | value.go | 281 | // - moveKey2 (points to vlog file 14) and | COMMENT |
| LOW | value.go | 301 | // L2 => .... | COMMENT |
| LOW | skl/skl.go | 41 | type node struct { | COMMENT |
| LOW | integration/lsmbench/main.go | 1 | /* | COMMENT |
| LOW | integration/lsmbench/main_test.go | 21 | // go test -v -tags=integration -timeout 60m ./integration/lsmbench/ | COMMENT |
| LOW | table/table.go | 181 | freeMe bool // used to determine if the blocked should be reused. | COMMENT |
| LOW | .github/workflows/ci-badger-lsm-bench.yml | 1 | name: ci-badger-lsm-bench | COMMENT |
| LOW | y/watermark.go | 41 | // WaterMark is used to keep track of the minimum un-finished index. Typically, an index k becomes | COMMENT |
| LOW | y/error.go | 1 | /* | COMMENT |
| LOW | y/bloom.go | 141 | } | COMMENT |
| LOW | y/bloom.go | 161 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | value_test.go | 1514 | // and learn which key it holds by iterating it (robust to fid ordering). | COMMENT |
| MEDIUM | table/table_test.go | 219 | // ti.Seek brings us to the first key >= "". Essentially a SeekToFirst. | COMMENT |
| MEDIUM | .github/workflows/ci-badger-lsm-bench.yml | 5 | # Builds the same harness (integration/lsmbench) against the PR's base and the | COMMENT |
| MEDIUM | .github/workflows/ci-badger-lsm-bench.yml | 72 | # Head: harness compiled against this checkout. | COMMENT |
| MEDIUM | .github/workflows/ci-badger-lsm-bench.yml | 74 | # Baseline: same harness source compiled against the base checkout, | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | db2_test.go | 647 | // Step 1 - Create badger data. It is necessary that the value size is | COMMENT |
| LOW⚡ | db2_test.go | 652 | // Step 2 - Re-open the same badger and simulate a crash. The value log file | COMMENT |
| LOW⚡ | db2_test.go | 656 | // Step 3 - Re-open the same badger. We should be able to read all the data | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | manifest_test.go | 115 | // TODO: Add test for file garbage collection here. No files should be left after the tests here. | COMMENT |
| LOW | table/table_test.go | 61 | // TODO: Add test for file garbage collection here. No files should be left after the tests here. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | options.go | 122 | // Feel free to modify these to suit your needs with the WithX methods. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test.sh | 7 | # Check if Github Actions is running | COMMENT |