hstephan23/dep_graph
DepGraph / TypeScript
Shows how dependency analysis becomes editor-visible feedback instead of a detached report, proving practical codebase-analysis judgment.
- Maps graph findings back to file URIs so the signal appears in the developer's normal editor workflow.
- Uses reach percentage as an explainable risk indicator, which makes the warning reviewable instead of vague.
DepGraph / TypeScripthstephan23/dep_graph
export class DepGraphDiagnostics {private collection: vscode.DiagnosticCollection;update(graph: GraphData): void {this.collection.clear();const root = getWorkspaceRoot();if (!root) { return; }const diagnosticMap =new Map<string, vscode.Diagnostic[]>();const addDiag = (fileId: string,diag: vscode.Diagnostic,) => {const absPath = path.join(root, fileId);const uri = vscode.Uri.file(absPath).toString();if (!diagnosticMap.has(uri)) {diagnosticMap.set(uri, []);}diagnosticMap.get(uri)!.push(diag);};for (const node of graph.nodes) {if (node.data.reach_pct > 50) {const pct = node.data.reach_pct.toFixed(1);const message = `High-impact file: ${pct}% reach`;const diag = new vscode.Diagnostic(new vscode.Range(0, 0, 0, 0),message,vscode.DiagnosticSeverity.Hint,);diag.source = "DepGraph";diag.code = "high-impact";addDiag(node.data.id, diag);}}}}