refactor: Code Refactoring of Implementation and Design Smells in Alovoa without any conflicts #393
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.
This PR comprises three code smell refactorings each at the implementation and design levels for alovoa.
Implementation Smell Refactoring 1:
Refactoring Technique Name : Extract method
Code Smell: Complex Method
Location :
Path: src/main/java
Package: alovoa/service
Class: RegisterService
Method: registerBase()
Implementation Smell Refactoring 2:
Refactoring Technique Name : Decompose Conditional
Code Smell: Complex Conditional
Location :
Path: src/main/java
Package: alovoa/service
Class: UserService
Method: hasNewMessage()
Implementation Smell Refactoring 3:
Refactoring Technique Name : Introducing Explaining Variable
Refactoring Technique Name: Magic Number
Location :
Path: src/main/java
Package: alovoa/model
Class: UserDto
Method: userToUserDto()
Design Smell Refactoring 1:
Refactoring Technique Name : Extract class
Code Smell: Insufficient modularization
Location :
Path: src/main/java
Package: alovoa/
Class: Tools
New Classes: CountryUtils and ValidationUtils
Dependency Classes Affected: service/MessageService and model/UserDto
Methods: getCountryEmoji() , isURLValid()
Design Smell Refactoring 2:
Refactoring Technique Name : Move Method
Code Smell: Feature Envy
Location :
Path: src/main/java
Package: alovoa/
Class: Tools
Class to which Method Moved : service/AuthService
Dependency Classes Affected : component/AuthSuccesshandler, rest/Oauth2Controller
Methods involved: getAuthParams()
Design Smell Refactoring 3:
Name : Pull Up Method & Extract Method
Code Smell: Insufficient Modularization
Location :
Path: src/main/java
Package: alovoa/service
Class: Tools
New Class: AgeUtils
Method: convertPrefAgeToRelativeYear(), convertPrefAgeToExactYear()