| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
BATCH_COMMANDS entries with sig: 'dbOnly' (currently only complexity) always wrote their target into opts.target. complexityData treats opts.target as a symbol-name filter and opts.file as the file-path filter, so batch complexity <file> never matched anything and the function list silently fell back to empty with a whole-repo summary regardless of which file was requested. Add an optional targetKey on BatchCommandEntry so each dbOnly command can declare which opts key its targets map to, and set it to 'file' for complexity. batchData and multiBatchData now route the target through the declared key instead of assuming opts.target. Fixes #1721 Impact: 4 functions changed, 6 affected
Greptile SummaryThis PR fixes a silent bug where codegraph batch complexity <files...> routed each file-path target into opts.target (a symbol-name filter) instead of opts.file (the file-scope filter), causing every target to silently return whole-repo stats. The fix introduces a targetKey field on BatchCommandEntry so any dbOnly command can declare which opts key its targets belong to, and wires complexity to targetKey: 'file'.
Confidence Score: 5/5Safe to merge — the change is a narrow, well-tested routing fix with no new external surface and no schema changes. The fix is minimal: one new optional field on an internal interface, one small helper function, and two call-site updates. Both batch entry points (batchData and multiBatchData) are updated consistently. The regression test directly exercises the broken code path with per-file fixtures, and the existing suite (3349 tests) continued to pass. There are no data mutations, no migration risk, and no change to any public API contract. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["batchData / multiBatchData\ncalled with targets[]"] --> B{entry.sig === 'dbOnly'?}
B -- No --> C["entry.fn(target, customDbPath, opts)\n(name / file / target sig)"]
B -- Yes --> D["dbOnlyTargetOpts(entry, opts, target)"]
D --> E{entry.targetKey defined?}
E -- No --> F["{ ...opts, target: batchTarget }\n(symbol-name filter)"]
E -- Yes --> G["{ ...opts, [targetKey]: batchTarget }\ne.g. { file: 'src/auth.js' }"]
F --> H["entry.fn(customDbPath, resolvedOpts)"]
G --> H
H --> I["Push result to results[]"]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["batchData / multiBatchData\ncalled with targets[]"] --> B{entry.sig === 'dbOnly'?}
B -- No --> C["entry.fn(target, customDbPath, opts)\n(name / file / target sig)"]
B -- Yes --> D["dbOnlyTargetOpts(entry, opts, target)"]
D --> E{entry.targetKey defined?}
E -- No --> F["{ ...opts, target: batchTarget }\n(symbol-name filter)"]
E -- Yes --> G["{ ...opts, [targetKey]: batchTarget }\ne.g. { file: 'src/auth.js' }"]
F --> H["entry.fn(customDbPath, resolvedOpts)"]
G --> H
H --> I["Push result to results[]"]
Reviews (2): Last reviewed commit: "fix: scope codegraph batch complexity ta..." | Re-trigger Greptile |
Sorry, something went wrong.
Codegraph Impact Analysis4 functions changed → 6 callers affected across 4 files
|
Sorry, something went wrong.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Closes #1721
Test plan