You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(graph): graph_name is silently discarded for dead_code and find_complexity, querying the default graph instead of the requested one #1531
tools/code_finder.py — self._active_graph = graph_name at :1204, clobbered by :792 (find_dead_code) and :1379 (find_most_complex_functions)
analyze_code_relationships sets the active graph on the shared instance field, then dispatches to inner methods at :1275 and :1284without forwarding graph_name. Both inner methods default the parameter to None and re-assign the same instance field, so self.driver resolves to db_manager.get_driver(None) — the default graph.
Reproduction
Instrumenting get_driver to record the graph name it receives:
dead_code -> [None] # graph_name="mygraph" was passed in
find_complexity -> [None]
find_callers -> ['mygraph'] # control: forwards correctly
Impact
FalkorDB is the default backend and is multi-graph, with one graph per indexed repository. So:
silently queries the default graph and returns dead-code results for a different repository — or an empty list if the default graph is empty. Same for find_complexity. The caller gets a plausible-looking answer about the wrong codebase, with no error.
More robustly, stop routing graph selection through mutable instance state — passing it as a parameter throughout removes this whole class of clobbering.
Environment
Commit
c0e0bed (main)
Python
3.12.3, Linux
Reproduced by instrumenting get_driver and invoking each query type.
Regression test spies on both inner methods and asserts the value arrives.
The deeper point in the issue stands and is worth revisiting separately: routing graph selection through the mutable self._active_graph is what made this possible in the first place, and passing it as a parameter throughout would make the whole class of bug structurally impossible.
Activity
github-actions commentedon Aug 1, 2026
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ
fix(query): five defects that returned wrong answers without erroring (…
Shashankss1205 commentedon Aug 5, 2026
Fixed in #1577 (merged).
graph_nameis now forwarded explicitly at both dispatch sites:Regression test spies on both inner methods and asserts the value arrives.
The deeper point in the issue stands and is worth revisiting separately: routing graph selection through the mutable
self._active_graphis what made this possible in the first place, and passing it as a parameter throughout would make the whole class of bug structurally impossible.