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

Refactored code in src/api/chats.js #35

Open
wants to merge 1 commit into
base: f24
Choose a base branch
from

Conversation

hibaabdullahhamad
Copy link

@hibaabdullahhamad hibaabdullahhamad commented Sep 2, 2024

I've added 4 helper functions to chats.js to reduce the cognitive complexity of the chatsAPI.update function, for more background, resolves issue #21.

These changes improve the adaptability of the code by breaking it down into smaller, more understandable functions and using meaningful variable names.

Added helper functions:

  • validateData
  • updateRoomName
  • updateGroups
  • emitRoomRenameEvent

Copy link

sonarcloud bot commented Sep 2, 2024

@coveralls
Copy link

Pull Request Test Coverage Report for Build 10662087631

Details

  • 11 of 15 (73.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 82.669%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/api/chats.js 11 15 73.33%
Totals Coverage Status
Change from base Build 10550029021: -0.002%
Covered Lines: 22327
Relevant Lines: 25587

💛 - Coveralls

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.

2 participants