MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / formatImpact

Method formatImpact

src/mcp/tools.ts:4618–4644  ·  view source on GitHub ↗
(symbol: string, impact: Subgraph)

Source from the content-addressed store, hash-verified

4616 }
4617
4618 private formatImpact(symbol: string, impact: Subgraph): string {
4619 const nodeCount = impact.nodes.size;
4620
4621 // Compact format: just list affected symbols grouped by file
4622 const lines: string[] = [
4623 `**Impact: "${symbol}" affects ${nodeCount} symbols**`,
4624 '',
4625 ];
4626
4627 // Group by file
4628 const byFile = new Map<string, Node[]>();
4629 for (const node of impact.nodes.values()) {
4630 const existing = byFile.get(node.filePath) || [];
4631 existing.push(node);
4632 byFile.set(node.filePath, existing);
4633 }
4634
4635 for (const [file, nodes] of byFile) {
4636 lines.push(`**${file}:**`);
4637 // Compact: inline list
4638 const nodeList = nodes.map(n => `${n.name}:${n.startLine}`).join(', ');
4639 lines.push(nodeList);
4640 lines.push('');
4641 }
4642
4643 return lines.join('\n');
4644 }
4645
4646 /**
4647 * Build a compact structural outline of a container symbol from its

Callers 1

handleImpactMethod · 0.95

Calls 3

getMethod · 0.65
setMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected