Deferred from PR #1308 review (Greptile).
In crates/codegraph-core/src/edge_builder.rs, the same-file method fallback for this/self/super receivers (around line 445) scans all methods in the file whose name ends with .methodName. When a file contains multiple unrelated classes (e.g. Shape, Calculator, Formatter), this.area() inside Shape.describe can match Calculator.area and Formatter.area too, producing false-positive call edges.
The TypeScript CHA post-pass (runChaPostPass) has an RTA filter after the fact, but the Rust path has no equivalent guard — all matched methods are returned and committed as edges.
Suggested fix: Before falling through to the full-file scan, first try restricting to the caller's own class name as a prefix (e.g. require n.name.starts_with("ClassName.")), only broadening to all same-file methods when no caller-class-scoped match is found.
Deferred from PR #1308 review (Greptile).
In
crates/codegraph-core/src/edge_builder.rs, the same-file method fallback forthis/self/superreceivers (around line 445) scans all methods in the file whose name ends with.methodName. When a file contains multiple unrelated classes (e.g.Shape,Calculator,Formatter),this.area()insideShape.describecan matchCalculator.areaandFormatter.areatoo, producing false-positive call edges.The TypeScript CHA post-pass (
runChaPostPass) has an RTA filter after the fact, but the Rust path has no equivalent guard — all matched methods are returned and committed as edges.Suggested fix: Before falling through to the full-file scan, first try restricting to the caller's own class name as a prefix (e.g. require
n.name.starts_with("ClassName.")), only broadening to all same-file methods when no caller-class-scoped match is found.