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

**issue (complexity):** Consider refactoring to reduce complexity. #48

Open
Shloimy15e opened this issue Aug 20, 2024 · 0 comments
Open
Assignees

Comments

@Shloimy15e
Copy link
Owner

          **issue (complexity):** Consider refactoring to reduce complexity.

The new code introduces additional complexity compared to the original. It adds more state variables (videoLikes, videoIsLiked, videoIsSaved), which increases the complexity of state management. The introduction of new asynchronous functions (likeAndUnlikeVideo and saveAndUnsaveVideo) adds more logic and potential points of failure, especially with error handling and API interactions. There's also more conditional logic, making the code harder to read. Consider refactoring to reduce complexity: combine similar functions, use a custom hook for API calls, and reduce state variables if possible. This can help make the component cleaner and easier to maintain.

Originally posted by @sourcery-ai[bot] in #33 (comment)

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

No branches or pull requests

1 participant