| 83 | } |
| 84 | |
| 85 | function isMeaningfulOrphan(node: PRNode, links: PRLink[]): boolean { |
| 86 | if (!node.isOrphan) return false; |
| 87 | if (node.status === "added") return false; |
| 88 | if (node.prZone === "primary" || node.prZone === "secondary") return false; |
| 89 | if (node.type === "Variable") return false; |
| 90 | if (node.name.startsWith("test_")) return false; |
| 91 | const hasOutgoing = links.some( |
| 92 | (l) => (typeof l.source === "object" ? (l.source as any).id : l.source) === node.id |
| 93 | ); |
| 94 | return !hasOutgoing; |
| 95 | } |
| 96 | |
| 97 | export function computePRInsights(data: PRGraphData): PRInsights { |
| 98 | const nodes = data.nodes || []; |