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

Prioritize cycles with the same minimum cut edges. #112

Open jimbethancourt opened 1 month ago

jimbethancourt commented 1 month ago

Cycles with the same edges should be prioritized first. The highest frequency edges should be prioritized first.

Maybe do something like this?

        Map<DefaultWeightedEdge, Integer> minCutEdgeCount = new HashMap<>();
        rankedCycles.stream().flatMap(rankedCycle -> rankedCycle.getMinCutEdges().stream()).forEach(minCutEdge ->
                minCutEdgeCount.put(minCutEdge, minCutEdgeCount.getOrDefault(minCutEdge, 0) + 1));