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

Function _add_rationale

graphify/extract.py:5783–5803  ·  view source on GitHub ↗
(text: str, line: int, parent_nid: str)

Source from the content-addressed store, hash-verified

5781 return None
5782
5783 def _add_rationale(text: str, line: int, parent_nid: str) -> None:
5784 label = text[:80].replace("\r\n", " ").replace("\r", " ").replace("\n", " ").strip()
5785 rid = _make_id(stem, "rationale", str(line))
5786 if rid not in seen_ids:
5787 seen_ids.add(rid)
5788 nodes.append({
5789 "id": rid,
5790 "label": label,
5791 "file_type": "rationale",
5792 "source_file": str_path,
5793 "source_location": f"L{line}",
5794 })
5795 edges.append({
5796 "source": rid,
5797 "target": parent_nid,
5798 "relation": "rationale_for",
5799 "confidence": "EXTRACTED",
5800 "source_file": str_path,
5801 "source_location": f"L{line}",
5802 "weight": 1.0,
5803 })
5804
5805 # Module-level docstring — skip for auto-generated files (Alembic, Django
5806 # migrations, protobuf stubs, etc.) whose module docstrings are revision

Callers 3

walk_docstringsFunction · 0.85
_extract_js_rationaleFunction · 0.85

Calls 1

_make_idFunction · 0.90

Tested by

no test coverage detected