New added test cases and code smell refactored. #207
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.
Added some new test cases and refactored some code smells.
Enhanced Code Clarity:
• Decomposed Conditions: Complex conditions in methods like isEmoji (EmojiManager) are broken down into smaller, more manageable checks. This improves readability and makes the code easier to understand.
• Extracted Methods: Long statements are extracted into separate methods, reducing code clutter and enhancing focus within the main functions.
• Renamed Methods/Variables: Methods and variables are renamed to adhere to Java naming conventions, making their purpose clearer.
Improved Maintainability:
• Pull-up Variables: Code duplication is reduced by pulling up repeated calls to methods like getUnicode into local variables within methods like equals (Emoji).
• Polymorphism: Conditional logic relying on specific implementations is replaced with polymorphism (e.g., isOnlyEmojis in EmojiManager). This allows for easier switching of validation strategies in the future.
• Moved Methods/Fields: Code with specific responsibilities is moved to dedicated helper classes (e.g., toString method moved to EmojiFormatter). This promotes modularity and reusability.