Pre-flight checks
What happened?
While working on a project, I found that calls inside keyword-form function bodies are missing from the graph. def a(x), do: b(x) produces the node a(), but no calls edge to b(), even though b is defined in the same module. One-line definitions are idiomatic Elixir (delegating wrappers, guards, small helpers), so a real code base loses a large share of its local call edges.
Where it happens (v8, graphify/extractors/elixir.py)
A function body is registered for walk_calls only when the definition has a do_block child (L252-253, if do_block_node: function_bodies.append(...)). The keyword form , do: expr has no do_block node. Its body is the value of the do: pair in the call's arguments keywords, so it is never walked.
Suggested fix
When a def/defp/defmacro/… has no do_block, take the value of the do: keyword in its arguments as the body and walk it the same way. The same applies to else:/rescue: keywords if they are handled for block bodies.
Steps to reproduce
mkdir -p repro2/lib && cd repro2
cat > lib/short.ex <<'EOF'
defmodule App.Short do
def a(x), do: b(x)
def b(x) do
x
end
end
EOF
uvx --python 3.13 --from graphifyy==0.9.80 graphify extract lib --code-only --no-cluster --out out
python3 -c "
import json
g = json.load(open('out/graphify-out/graph.json'))
print([(e['source'], e['target']) for e in g['edges'] if e['relation'] == 'calls'])
"
Error output or graph output
[]
expected: [('app_short_app_short_a', 'app_short_app_short_b')]
Graphify version
0.9.80
Operating System
macOS
Python Version
3.13
Installation Method
uv tool install (recommended)
Additional Environment Details
No provider environment variables set (--code-only, no LLM). Reproduced in a fresh directory containing only the four files above.
Additional context
No response
Pre-flight checks
What happened?
While working on a project, I found that calls inside keyword-form function bodies are missing from the graph.
def a(x), do: b(x)produces the nodea(), but nocallsedge tob(), even thoughbis defined in the same module. One-line definitions are idiomatic Elixir (delegating wrappers, guards, small helpers), so a real code base loses a large share of its local call edges.Where it happens (
v8,graphify/extractors/elixir.py)A function body is registered for
walk_callsonly when the definition has ado_blockchild (L252-253,if do_block_node: function_bodies.append(...)). The keyword form, do: exprhas nodo_blocknode. Its body is the value of thedo:pair in the call'sargumentskeywords, so it is never walked.Suggested fix
When a
def/defp/defmacro/… has nodo_block, take the value of thedo:keyword in its arguments as the body and walk it the same way. The same applies toelse:/rescue:keywords if they are handled for block bodies.Steps to reproduce
Error output or graph output
Graphify version
0.9.80
Operating System
macOS
Python Version
3.13
Installation Method
uv tool install (recommended)
Additional Environment Details
No provider environment variables set (
--code-only, no LLM). Reproduced in a fresh directory containing only the four files above.Additional context
No response