Repository navigation
Description
graphify version: 0.9.10 (pip package graphifyy)
Language: C#
Corpus: ~6,300 C# files, AST-only extraction via graphify update <path> (no LLM/semantic backend configured)
Bug
A method call chained directly onto a new X(...) object-creation expression (no intermediate variable) is not captured at all — neither as a calls edge to the invoked method, nor as a references/instantiation edge to the constructed type.
Repro
Source (ToolProductSvc.cs):
public ConnectableItemsGroupInformation GetMachineConnectableItemsInformationExt(
GetConnectableItemsContext getConnectableItemsContext)
{
return new StatefulFiltersMerger(getConnectableItemsContext.QueryContextFields)
.GetConnectableItemsInformation(getConnectableItemsContext, true);
}Expected: a calls edge from GetMachineConnectableItemsInformationExt to StatefulFiltersMerger.GetConnectableItemsInformation, and/or a reference edge to the StatefulFiltersMerger class.
Actual: the caller's node has zero calls edges. Its only outgoing edges are two references edges — to ConnectableItemsGroupInformation (return type) and GetConnectableItemsContext (parameter type). Nothing points at StatefulFiltersMerger or .GetConnectableItemsInformation(), even though both of those nodes exist correctly elsewhere in the same graph.
Verified via direct inspection of the output graph.json:
- Caller node id:
webservices_toolproductsvc_machiningcloud_server_webservices_toolproductsvc_getmachineconnectableitemsinformationext— outgoing edges: 2references, 0calls. StatefulFiltersMergerclass node exists correctly atSource/Server/Logic/ToolProduct/Filters/StatefulFiltersMerger.cs:L55..GetConnectableItemsInformation()method node exists correctly atSource/Server/Logic/ToolProduct/Filters/StatefulFiltersMerger.cs:L126.- No edge of any relation connects the caller to either of those two nodes, in either direction.
Suspected cause
The call-graph pass likely only attributes a calls edge when the receiver of a method call is a resolvable named symbol (local variable, field, parameter). A call fluently chained directly onto a new X(...) expression — i.e. new X(...).Method() with no assignment — appears to fall outside what the extractor's call-detection matches, and the constructor invocation itself isn't recorded as a reference either.
This is likely systematic rather than a one-off: any fluent/chained call directly off a constructor invocation anywhere in a C# corpus would silently disappear from the graph rather than erroring or warning, which could meaningfully understate a class's real dependencies/call graph.
Environment
- graphify 0.9.10 (
graphifyyon PyPI) - OS: Windows 11
- Extraction:
graphify update <path>(AST-only, C# tree-sitter grammar)
Activity
safishamsi commentedon Jul 10, 2026
The reported bug is already fixed in current releases (you're on 0.9.10; current is 0.9.12, with 0.9.13 in progress). On v8,
new StatefulFiltersMerger(...).GetConnectableItemsInformation(...)— a method chained directly off anew X(...)expression with no intermediate variable — does emit acallsedge to the constructed type's method. Verified on a faithful repro (the caller getscalls -> .GetConnectableItemsInformation()), and added a regression test for the fluent new-expression receiver.On the secondary point — no
references/instantiation edge to the constructed class itself: that's graphify's general behavior, not specific to chainednew. A variable-basedvar w = new Widget(); w.Go()likewise emitscalls -> Go()but no edge toWidget— graphify doesn't currently model constructor invocation as a class-reference edge in any receiver form. If you'd like instantiation edges (new X()-> X) as a first-class relation, that's a reasonable enhancement — happy to track it as a separate feature request, since it'd apply uniformly across languages, not just this pattern. Please upgrade (uv tool install --upgrade graphifyy) to pick up the call-resolution fix. Thanks for the precise repro.test(csharp): chained call off new X(...) resolves (#1770)
crokusek commentedon Jul 10, 2026
We will upgrade now. Thank you for the details. Not sure the secondary point is needed yet, will file a request tbd.
test(csharp): chained call off new X(...) resolves (Graphify-Labs#1770)
fix(csharp): never bind a nameless member-call receiver to a same-nam…