From 5593af76ca4c39e8091003ce9f16b7452e700bbf Mon Sep 17 00:00:00 2001 From: Nikola Chetelyazov Date: Mon, 13 Apr 2026 09:44:17 +0300 Subject: [PATCH] refactor: extract endpoint label into variable to avoid duplicated template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The endpoint name template was evaluated twice — once for name and once for summary. A single const removes the duplication and resolves the nested template literal lint warning. --- .../packages/core/src/analyzer/graph-builder.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts b/understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts index f74cb7e..d77155b 100644 --- a/understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts +++ b/understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts @@ -328,14 +328,15 @@ export class GraphBuilder { console.warn(`[GraphBuilder] Duplicate node ID "${childId}" — skipping`); continue; } + const name = `${ep.method ?? ""} ${ep.path}`.trim() this.nodeIds.add(childId); this.nodes.push({ id: childId, type: "endpoint", - name: `${ep.method ?? ""} ${ep.path}`.trim(), + name, filePath, lineRange: ep.lineRange, - summary: `Endpoint: ${ep.method ?? ""} ${ep.path}`.trim(), + summary: `Endpoint: ${name}`, tags: [], complexity: meta.complexity, });