Repository navigation
Description
Summary
For C++, a scope-qualified static call Class::Method(...) is not linked with a calls edge when the callee method node exists only in qualified form (label Class::Method()). This happens systematically for Unreal Engine UCLASS() / GENERATED_BODY() classes: the macro-laden header declaration is not parsed, so the method node is created only from the .cpp definition (Class::Method), with a qualified label. The call resolver matches call-sites by the bare callee identifier, so it never matches the qualified-labeled node, and the edge is dropped.
Consequence: graphify affected "<Class>" misses every static-call caller of that class's methods — dangerous for impact analysis / refactor gating (an "only affects X" that is incomplete).
Environment: graphify 0.9.13 · tree-sitter-cpp 0.23.4 · Python 3.10 · Windows
Minimal reproduction
Case A — plain class (WORKS, control)
helper.h declares static Helper* FindNearest();, helper.cpp defines it, caller.cpp calls Helper::FindNearest(). Result: the method node is labeled FindNearest (bare, from the header) and the qualified call links correctly:
useQualified() --[calls]--> FindNearest ✅
Case B — Unreal UCLASS (BUG)
// helper.h
#pragma once
#include "CoreMinimal.h"
#include "helper.generated.h"
UCLASS()
class AHelper : public AActor {
GENERATED_BODY()
public:
UFUNCTION()
static AHelper* FindNearest(UWorld* W);
};
// helper.cpp
#include "helper.h"
AHelper* AHelper::FindNearest(UWorld* W) { return nullptr; }
// caller.cpp
#include "helper.h"
void useIt(UWorld* W) {
AHelper* h = AHelper::FindNearest(W); // qualified static call
(void)h;
}graphify extract . --code-only produces:
- Node
AHelper::FindNearest()(label qualified, sourced fromhelper.cpp— the header declaration insideGENERATED_BODY()was not extracted). - Edges from
useIt():--[references]--> AHelper,--[references]--> UWorld. - No
callsedgeuseIt() --> AHelper::FindNearest(). ❌
The only difference between A and B is whether a bare-named method node exists. When the method exists only as a qualified node, the call is not linked.
Expected
useIt() --[calls]--> AHelper::FindNearest() should exist, and affected "AHelper" should list useIt as an impacted caller.
Suggested fixes (either resolves it)
- Call resolver: when a call callee is a
qualified_identifier(Class::Method), match it against method nodes labeledClass::Method()(and/or by the bare method segment), not only against bare-named nodes. - Header parsing: handle
UCLASS()/GENERATED_BODY()/UFUNCTION()macro bodies so method declarations produce bare method nodes (as in the plain-class case).
Real-world impact
On an Unreal project, affected "AXylosHelperCharacter" returned 1 caller where git grep found 3 real Class::FindNearest(...) static call-sites — so the reported blast radius was 1/3 of the true one.
Activity
safishamsi commentedon Sep 20, 2026
Fixed in v0.9.64 via #3613 — C++ scope-qualified static calls resolve to a definition in another translation unit. Thanks @ayushcodes10.