ucn 3.7.43 → 3.7.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/core/callers.js +15 -4
  2. package/package.json +1 -1
package/core/callers.js CHANGED
@@ -646,9 +646,21 @@ function findCallees(index, def, options = {}) {
646
646
  // Respect includeMethods=false — skip self/this method resolution entirely
647
647
  if (selfAttrCalls && def.className && options.includeMethods !== false) {
648
648
  const attrTypes = getInstanceAttributeTypes(index, def.file, def.className);
649
- if (attrTypes) {
650
- for (const call of selfAttrCalls) {
651
- const targetClass = attrTypes.get(call.selfAttribute);
649
+ for (const call of selfAttrCalls) {
650
+ let targetClass = attrTypes ? attrTypes.get(call.selfAttribute) : null;
651
+ // Unique method heuristic: if attr type unknown but method exists on exactly one class
652
+ if (!targetClass) {
653
+ const methodSyms = index.symbols.get(call.name);
654
+ if (methodSyms) {
655
+ const classNames = new Set();
656
+ for (const s of methodSyms) {
657
+ if (s.className) classNames.add(s.className);
658
+ }
659
+ if (classNames.size === 1) {
660
+ targetClass = classNames.values().next().value;
661
+ }
662
+ }
663
+ }
652
664
  if (!targetClass) continue;
653
665
 
654
666
  // Find method in symbol table where className matches
@@ -670,7 +682,6 @@ function findCallees(index, def, options = {}) {
670
682
  });
671
683
  }
672
684
  }
673
- }
674
685
  }
675
686
 
676
687
  // Third pass: resolve self/this/super.method() calls to same-class or parent methods
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ucn",
3
- "version": "3.7.43",
3
+ "version": "3.7.44",
4
4
  "mcpName": "io.github.mleoca/ucn",
5
5
  "description": "Universal Code Navigator — AST-based call graph analysis for AI agents. Find callers, trace impact, detect dead code across JS/TS, Python, Go, Rust, Java, and HTML. CLI, MCP server, and agent skill.",
6
6
  "main": "index.js",