refactor: extract endpoint label into variable to avoid duplicated template

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.
This commit is contained in:
Nikola Chetelyazov
2026-04-13 09:44:17 +03:00
Unverified
parent 6c55ee303a
commit 5593af76ca
@@ -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,
});