@@ -594,6 +594,11 @@ String buildClassGraphDot(
594594 return toJavaScriptTemplateLiteral (buildRawClassGraphDot (classGraph , repoUrl , codebaseGraphDTO ));
595595 }
596596
597+ /**
598+ * Appends class DOT nodes, omitting sink-only anonymous or synthetic vertices and labels that
599+ * match their node IDs. Includes source-link attributes supplied by the report and highlights
600+ * classes selected for removal.
601+ */
597602 private void renderClassVertices (
598603 Graph <String , DefaultWeightedEdge > classGraph ,
599604 String repoUrl ,
@@ -609,19 +614,23 @@ private void renderClassVertices(
609614 continue ;
610615 }
611616
612- dot .append (renderSafeNodeId (vertex , classGraph , codebaseGraphDTO ));
617+ String safeNodeId = renderSafeNodeId (vertex , classGraph , codebaseGraphDTO );
618+ dot .append (safeNodeId );
613619
614620 dot .append (" [" );
615621 dot .append (hyperlinkClassForDot (vertex , repoUrl , codebaseGraphDTO ));
616622
623+ String label ;
617624 if (isAnonymousFqn (vertex )) {
618625 // Kotlin "<anonymous>" renders under the enclosing source file's base name as the
619626 // owner with $ as the enclosing-class separator (escaped for DOT).
620- dot .append (" label=\" " )
621- .append (escapeDotQuoted (anonymousOwnerLabel (vertex , codebaseGraphDTO )))
622- .append ("\" " );
627+ label = escapeDotQuoted (anonymousOwnerLabel (vertex , codebaseGraphDTO ));
623628 } else {
624- dot .append (" label=\" " ).append (escapeDotQuoted (className )).append ("\" " );
629+ label = escapeDotQuoted (className );
630+ }
631+
632+ if (!label .equals (safeNodeId )) {
633+ dot .append (" label=\" " ).append (label ).append ("\" " );
625634 }
626635
627636 if (classesToRemove .contains (vertex )) {
0 commit comments