Closed risvarrt closed 3 months ago
Yes, It is a part of my assignment. Also, I wanted to apply my learnings on refactoring and code smells on this repository Let me know if any other changes are needed here.
Ok. Would you be able to share the detailed instructions you have been given for this assignment?
This pull request introduces a series of six refactoring changes aimed at enhancing the readability, maintainability, and overall design of the codebase. Each refactoring is summarized below:
Introduce Explaining Variables
Refactored the equalTimeValue method within the Equality class by adding two explaining variables: equalTimeStamp and equalTolerance.
Extract Method
Simplified the getJsonDatatypeFromDatatypeIri method in the DataTypeIdImpl class by extracting logic for the default case to a new method, enhancing readability.
Decompose Conditional - WbEditingAction
Improved the performAPIAction method within the WbEditingAction class by decomposing conditional logic into smaller methods (validateIfnewEntity, validateEditEntityDataUsingId, validateEditEntityData), focusing on core logic.
Extract Class - DataTypeJsonUtils
Introduced the DataTypeJsonUtils class to separate JSON conversion logic from execution logic, adhering to the Single Responsibility Principle.
Move Method - getReferenceUri
Improved design by moving getReferenceUri logic from Vocabulary to ReferenceRdfConverters, aligning responsibilities with the classes most directly involved.
Pull up Variable - constructTermMap and toTerm
Centralized the constructTermMap and toTerm methods by pulling them up into the StatementDocumentImpl class. This change eliminates duplication and simplifies constructTermMap across various inherited classes.
Each refactoring change preserves the existing functionality and interface contracts, ensuring backward compatibility and uninterrupted operation. The focus has been on internal improvements that enhance our code's structure without altering its behavior from an external viewpoint.
Your feedback and suggestions on these refactorings are welcome.