Refactor/smell free solid clean code#7514
Open
nabila1644-iit wants to merge 12 commits into
Open
Conversation
… I/O (SRP), remove unused processes array, add input validation and try-with-resources
… and rendering to resolve SRP/OCP/DIP violations, remove duplicate code and hardcoded constants
…te, and Solver abstractions to resolve SRP/OCP/DIP violations and Long Method/Feature Envy/Data Clumps smells
…orithms to resolve SRP/OCP/DIP violations
…and SRP violation, remove duplicate code
…e code, depend on List interface internally while preserving ArrayList return type for backward compatibility
…, and Trie access to resolve SRP violation and Inappropriate Intimacy smell
…and inappropriate intimacy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
Refactor BronKerbosch.java to resolve SRP/OCP/DIP violations and Bloater/Coupler smells
What issues were addressed
findMaximalCliquesmixed validation, graph copying, and algorithm init in one methodbronKerboschPivotand helpers were static utilities not tied to any objectList<Set<Integer>>used instead of a typed graph abstractionr,p,xalways traveled together without being packaged as a unitHashSet/ArrayListtypesWhy these changes improve the system
PivotStrategywithout touching the algorithm (OCP)Graphinterface, not concrete collection types (DIP)SearchStatereplaces the r/p/x data clump with an immutable, self-validating value objectSummary of refactoring approach
Graphinterface +AdjacencyListGraphimplementation to decouple the algorithm from raw collectionsGraphValidatorto isolate input-validation logicPivotStrategyinterface withMaxDegreePivotStrategyas the default implementationSearchStatevalue object, deriving new states viaexpandWith/processVertexinstead of in-place mutationBronKerbosch.findMaximalCliques(List<Set<Integer>>)) unchanged as a façade over the new internal designFunctionality assurance