refactorfirst / RefactorFirst

Identifies and prioritizes God Classes Highly Coupled classes, and Class Cycles in Java codebases you should refactor first.
Apache License 2.0
457 stars 42 forks source link

Replace Image generation with DOT JS-based rendering #101

Closed jimbethancourt closed 1 month ago

jimbethancourt commented 1 month ago

Sonatype has identified that JGraphX has a known vulnerability: https://sbom.sonatype.com/report/T1-a4e79c5353879ed9b588-3209d9d507fc3a-1727273211-8e351c4d6ac9418cb8a26ab64b24c8db

To address this, a DOT file should be generated by RefactorFirst and then rendered via a Javascript library call similar to the following:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Graphviz Example</title>
    <script src="https://d3js.org/d3.v5.min.js"></script>
    <script src="https://unpkg.com/d3-graphviz@3.0.5/build/d3-graphviz.min.js"></script>
</head>
<body>
    <div id="graph"></div>
    <script>
        // Fetch the DOT file
        fetch('path/to/your/file.dot')
            .then(response => response.text())
            .then(dot => {
                // Render the graph
                d3.select("#graph")
                    .graphviz()
                    .renderDot(dot);
            });
    </script>
</body>
</html>
jimbethancourt commented 1 month ago

Released in 0.6.0