MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _scan_module_dispatch

Function _scan_module_dispatch

graphify/extract.py:5627–5645  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

5625 module_bound = _python_module_bound_names(root, source)
5626
5627 def _scan_module_dispatch(n) -> None:
5628 if n.type in ("function_definition", "class_definition"):
5629 return
5630 if n.type in ("dictionary", "list", "set", "tuple"):
5631 for ident in _python_dispatch_value_idents(n):
5632 _emit_indirect_ref(ident, file_nid, module_bound, "collection")
5633 elif n.type == "assignment":
5634 # Module-level alias / re-export: CALLBACK = handler
5635 for ident in _python_ref_value_idents(n.child_by_field_name("right")):
5636 _emit_indirect_ref(ident, file_nid, module_bound, "assignment")
5637 elif n.type == "call":
5638 # Module-level reflective dispatch: HANDLER = getattr(mod, "handler")
5639 # (#1566 slice 3). Attributed to the file node, like a module table.
5640 getattr_ref = _getattr_ref_name(n)
5641 if getattr_ref is not None:
5642 ref_name, loc = getattr_ref
5643 _emit_indirect_by_name(ref_name, loc, file_nid, "getattr")
5644 for c in n.children:
5645 _scan_module_dispatch(c)
5646
5647 _scan_module_dispatch(root)
5648 elif config.ts_module in ("tree_sitter_javascript", "tree_sitter_typescript"):

Callers 1

_extract_genericFunction · 0.85

Calls 5

_emit_indirect_refFunction · 0.85
_python_ref_value_identsFunction · 0.85
_getattr_ref_nameFunction · 0.85
_emit_indirect_by_nameFunction · 0.85

Tested by

no test coverage detected