Elixir: defdelegate function definitions are dropped
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #4133 by @rajatnagda45 — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 25/100
Research direction
Start with extract_elixir and the def-handling keyword set mentioned in the issue. Run the supplied facade.ex reproduction and inspect the extracted nodes and calls. Done means start and stop appear as function nodes and run has calls to both; a linked pull request is already open.
Written by the indexing model from the issue text.
Description
Version / commit
v0.9.77 (v8 @ 5c7b847)
Environment
macOS, Python 3.13, clean checkout of v8.
What happens
defdelegate name(args), to: Mod defines a real, public module function (it forwards its body to another module), but it is not extracted. The delegated function never becomes a node, and an intra-module call to it resolves to nothing — so parts of a module's public surface vanish from the graph.
Minimal reproduction
# facade.ex
defmodule Facade do
defdelegate start(x), to: Worker
defdelegate stop(x), to: Worker, as: :halt
def run(x) do
start(x)
stop(x)
end
end
from graphify.extract import extract_elixir
r = extract_elixir("facade.ex")
print(sorted((n.get("label") or "").rstrip("()") for n in r["nodes"]))
# -> ['Facade', 'facade.ex', 'run'] # start / stop missing
print([(e["source"], e["target"]) for e in r["edges"] if e["relation"] == "calls"])
# -> [] # run -> start, run -> stop unresolved
Expected vs actual
- Expected:
startandstopfunction nodes, withrun --calls--> startandrun --calls--> stop. - Actual: the delegated functions are absent and the calls dangle.
Root cause
defdelegate has the same call head shape as def (its first argument is the function signature), but it is not in the def-handling keyword set, so it falls through to the generic recursion and is dropped.
A clean checkout of v8 reproduces it. Fix PR to follow.
- Dominant language
- Python
- Stars
- 124k
- Forks
- 11.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Graphify-Labs/graphify
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Graphify-Labs/graphify#3763 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Graphify-Labs/graphify#3611 · 1 comment ·
Maintainers usually reply within 1 day
-
Nix supportOpen
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Graphify-Labs/graphify#3193 · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Graphify-Labs/graphify#2871 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Graphify-Labs/graphify#2865 ·
Maintainers usually reply within 1 day
All issues in Graphify-Labs/graphify
Similar issues
-
bug difficulty:2 good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MakazhanAlpamys/Soup#1865 ·
Maintainers usually reply within 1 day
-
area: agents area: docs good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openapi/gknowledge#23 ·
-
useless-suppression reported for deprecated-* messages that should be exemptPossibly taken @adityasinha-ghub claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pylint-dev/pylint#11656 ·
Maintainers usually reply within 1 day
-
area:provisioning effort:S priority:P2 provider:local-libvirt risk:daytime-only status:in-progress type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
randomparity/kdive#3203 · 2 comments ·
Maintainers usually reply within 1 day
-
get() for StrEnumPossibly taken @FeJo5952 claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
collective/icalendar#1921 · 1 comment ·
Maintainers usually reply within 1 day