Skip to content

fix: filter method call noise from call graph#108

Closed
gzenz wants to merge 2 commits intotirth8205:mainfrom
gzenz:fix/filter-method-call-noise
Closed

fix: filter method call noise from call graph#108
gzenz wants to merge 2 commits intotirth8205:mainfrom
gzenz:fix/filter-method-call-noise

Conversation

@gzenz
Copy link
Copy Markdown
Contributor

@gzenz gzenz commented Apr 5, 2026

Summary

  • obj.method(), response.json(), data.get() were recorded as bare CALLS targets (method, json, get), creating false callers via name collisions
  • Now only self/cls/this/super method calls emit CALLS edges -- external method calls are dropped
  • Handles Python super().method() pattern (call node wrapping super identifier)

Impact (measured on this repo, Python-only)

Metric Before After Change
Total CALLS edges 3006 1262 -58%
Resolved (qualified) 403 377 -6%
Bare (unresolvable) 2603 885 -66%

Test plan

  • test_method_call_filtering_python_self -- self.method() emits CALLS
  • test_method_call_filtering_python_external -- obj.method() does not
  • test_method_call_filtering_python_super -- super().method() emits CALLS
  • test_method_call_filtering_ts_this -- this.method() emits CALLS
  • test_method_call_filtering_ts_external -- obj.method() does not
  • Updated Vue, vitest, Rust, Java tests for new behavior
  • Full suite: 570 passed, 0 failed

Method calls like obj.method(), response.json(), data.get() were recorded
as bare CALLS targets ("method", "json", "get"), creating false callers
via name collisions and polluting the graph with unresolvable noise.

Now only self/cls/this/super method calls emit CALLS edges -- these
resolve within the class. External method calls are dropped since they
are unresolvable without type inference.

Impact on this repo (Python): 58% fewer CALLS edges total, but only 6%
fewer resolved edges -- almost all useful relationships preserved.
… fallback

- Exempt test files from method call filtering so TESTED_BY edges are
  preserved (test code calls production via object.method())
- Add jsx_self_closing_element and jsx_opening_element to _CALL_TYPES
  for tsx/javascript -- <Component /> now produces CALLS edges
- Add _BUILTIN_NAMES per-language filter to skip len/print/str/etc.
- Add Leiden-to-file-based fallback in communities.py when all Leiden
  clusters are smaller than min_size (fixes 0 communities regression)
- Update test paths to use /src/ for production code tests (not /test/)
@gzenz gzenz marked this pull request as draft April 5, 2026 21:59
Copy link
Copy Markdown
Owner

@tirth8205 tirth8205 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 58% edge reduction is impressive and the filtering logic (keeping only self/cls/this/super method calls) makes sense. Good test coverage.

Please rebase on latest main — there have been several merges recently. Once rebased and CI passes, we'll review for merge.

@tirth8205
Copy link
Copy Markdown
Owner

Review: PR #108 — fix: filter method call noise (DRAFT)

This PR is superseded by PR #158, which incorporates this fix and many more improvements from the same author. The 58% reduction in spurious CALLS edges is included in #158.

Recommendation: Close this PR in favor of #158. The owner's comment already asked for a rebase, and gzenz subsequently opened #158 as the consolidated replacement (confirmed in #103's comments).

Note: This PR is still in DRAFT status.

@gzenz
Copy link
Copy Markdown
Contributor Author

gzenz commented Apr 11, 2026

Superseded by #158.

@gzenz gzenz closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants