Skip to content

Optimize generated class DOT - #225

Merged
jimbethancourt merged 4 commits into
mainfrom
optimize-class-dot
Oct 3, 2026
Merged

jimbethancourt merged 4 commits into
mainfrom
optimize-class-dot

Conversation

@jimbethancourt

@jimbethancourt jimbethancourt commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator
  • Only appending label to class nodes that need it
  • Not including hyperlinks in refactor-first.json files since they take up a fair amount of disk space.

Devin Review

Summary by CodeRabbit

  • Bug Fixes
    • Class dependency graphs now omit redundant node labels when the displayed label matches the node ID, while retaining labels when they differ. Source links and their target behavior remain unchanged, including links for Kotlin cycle nodes.
    • JSON reports no longer include DOT hyperlinks. This changes the generated report output and may affect how DOT-related links appear in tools that consume those reports.

- Only appending `label` to class nodes that need it
- Not including hyperlinks in refactor-first.json files since they take up a fair amount of disk space.
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 368c1a98-f877-452a-9dd8-8224b747382e
📥 Commits

Reviewing files that changed from the base of the PR and between 799d099 and 69a923d.

📒 Files selected for processing (3)
  • report/src/main/java/org/hjug/refactorfirst/report/HtmlReport.java
  • report/src/test/java/org/hjug/refactorfirst/report/HtmlReportKotlinTest.java
  • report/src/test/java/org/hjug/refactorfirst/report/HtmlReportTest.java
🚧 Files skipped from review as they are similar to previous changes (3)
  • report/src/test/java/org/hjug/refactorfirst/report/HtmlReportTest.java
  • report/src/test/java/org/hjug/refactorfirst/report/HtmlReportKotlinTest.java
  • report/src/main/java/org/hjug/refactorfirst/report/HtmlReport.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Class-graph DOT rendering now omits labels when they match the safe node ID. JsonGenerator adds a package-private method that returns an empty string. Tests update expected DOT declarations and reformat an unchanged generated fixture string.

Changes

Class-graph DOT output

Layer / File(s) Summary
Add DOT hyperlink helper
report/src/main/java/org/hjug/refactorfirst/report/JsonGenerator.java, report/src/test/java/org/hjug/refactorfirst/report/JsonGeneratorTest.java
JsonGenerator adds a package-private method that returns an empty string. The test fixture reformats an append call without changing its generated source text.
Render class vertices and update expected DOT
report/src/main/java/org/hjug/refactorfirst/report/HtmlReport.java, report/src/test/java/org/hjug/refactorfirst/report/HtmlReportTest.java, report/src/test/java/org/hjug/refactorfirst/report/HtmlReportKotlinTest.java
Class vertices emit a label only when the escaped label differs from the safe node ID. Java and Kotlin test expectations omit redundant labels.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 69a92

No newly introduced merge-blocking issue is established; the remaining cycle-breakdown hyperlinks are pre-existing.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 799d0

The change reduces generated graph attributes without adding access, privileges, or destinations. HTML reports retain source links, while JSON class graphs omit them. No material security risk was found in the changed behavior.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed reachability is confined to generated report content consumed by graph viewers. Removing class-node hyperlinks from JSON narrows that navigation channel; the inspected change introduces no new input authority, destination, or execution path.

Trust Boundaries and Controls

  • observed — Repository-derived names, source paths, and URLs already enter the report-generation boundary. Retained DOT labels and HTML-report DOT URLs still use escapeDotQuoted, and class-cycle JavaScript-template escaping is unchanged. The JSON override does not remove hyperlinks from separate relationship, cycle-breakdown, and disharmony fields; those pre-existing channels remain outside its scope.

Resilience and Maintainability Implications

  • observed — The override changes serialized content without changing persistent-state ownership or replacement ordering. JsonGenerator continues serializing the DTO, writing a temporary file, and atomically replacing refactor-first.json. No new multi-step state transition is introduced.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and describes the main change: reducing redundant labels in generated class DOT output. It does not mention the separate JSON hyperlink change, but the title does not need to cove…
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Completed: Fix pre-merge checks in PR #225 — View commit 69a923d

@jimbethancourt
jimbethancourt merged commit dabe805 into main Oct 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant