Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New added test cases and code smell refactored. #207

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

samshad
Copy link

@samshad samshad commented Mar 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant