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

Function add_node

graphify/extractors/engine.py:9563–9584  ·  view source on GitHub ↗
(nid: str, label: str, line: int, *, node_type: str | None = None,
                 metadata: dict | None = None)

Source from the content-addressed store, hash-verified

9561 lua_field_groups = _lua_pre_scan_field_collisions(root, source, stem)
9562
9563 def add_node(nid: str, label: str, line: int, *, node_type: str | None = None,
9564 metadata: dict | None = None) -> None:
9565 if nid in seen_ids:
9566 return
9567 seen_ids.add(nid)
9568 merged = dict(metadata or {})
9569 if namespace_stack:
9570 merged.setdefault("namespace", ".".join(namespace_stack))
9571 if scope_stack and node_type != "namespace":
9572 merged.setdefault("scope_chain", list(scope_stack))
9573 node = {
9574 "id": nid,
9575 "label": label,
9576 "file_type": "code",
9577 "source_file": str_path,
9578 "source_location": f"L{line}",
9579 }
9580 if node_type:
9581 node["type"] = node_type
9582 if merged:
9583 node["metadata"] = sanitize_metadata(merged)
9584 nodes.append(node)
9585
9586 def add_edge(src: str, tgt: str, relation: str, line: int,
9587 confidence: str = "EXTRACTED", weight: float = 1.0,

Callers 7

emitFunction · 0.70
_ruby_extra_walkFunction · 0.70
_extract_genericFunction · 0.70
decl_nodeFunction · 0.70
csharp_add_constructorFunction · 0.70
walkFunction · 0.70

Calls 2

sanitize_metadataFunction · 0.90
joinMethod · 0.45

Tested by

no test coverage detected