MCPcopy
hub / github.com/safishamsi/graphify / add_node

Function add_node

graphify/extract.py:40–49  ·  view source on GitHub ↗
(nid: str, label: str, line: int)

Source from the content-addressed store, hash-verified

38 seen_ids: set[str] = set()
39
40 def add_node(nid: str, label: str, line: int) -> None:
41 if nid not in seen_ids:
42 seen_ids.add(nid)
43 nodes.append({
44 "id": nid,
45 "label": label,
46 "file_type": "code",
47 "source_file": str_path,
48 "source_location": f"L{line}",
49 })
50
51 def add_edge(src: str, tgt: str, relation: str, line: int) -> None:
52 # Only add edge if both endpoints exist or src is the file node

Callers 13

extract_pythonFunction · 0.85
walkFunction · 0.85
extract_jsFunction · 0.85
extract_goFunction · 0.85
extract_rustFunction · 0.85
extract_javaFunction · 0.85
extract_cFunction · 0.85
extract_cppFunction · 0.85
extract_rubyFunction · 0.85
extract_csharpFunction · 0.85
extract_kotlinFunction · 0.85
extract_scalaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected