Skip to content

refactored lines 46 to 70 to have helper functions and simplify the code, src/messaging/rooms.js#78

Open
safa-amin wants to merge 2 commits into
CMU-17313Q:f24from
safa-amin:refactor-messaging-rooms
Open

refactored lines 46 to 70 to have helper functions and simplify the code, src/messaging/rooms.js#78
safa-amin wants to merge 2 commits into
CMU-17313Q:f24from
safa-amin:refactor-messaging-rooms

Conversation

@safa-amin
Copy link
Copy Markdown

@safa-amin safa-amin commented Sep 3, 2024

This resolves issue #12

I refactored the 'modifyRoomData' function to be more efficient. In my new refactored code, the function essentially processes an array of room data objects, updating various fields based on certain conditions. The function goes through the integer fields, checks the room name (leaves), determines if the room is public and updates the notification settings if required.

I also added helper functions 'shouldUpdateNotificationSetting' and 'shouldUpdateGroups' to simplify the original code.

@coveralls
Copy link
Copy Markdown

coveralls commented Sep 3, 2024

Pull Request Test Coverage Report for Build 10718553140

Details

  • 14 of 16 (87.5%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 82.673%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/messaging/rooms.js 14 16 87.5%
Totals Coverage Status
Change from base Build 10550029021: 0.002%
Covered Lines: 22327
Relevant Lines: 25586

💛 - Coveralls

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Sep 5, 2024

@safa-amin safa-amin changed the title refactored lines 46 to 70 to have helper functions and simplify the code refactored lines 46 to 70 to have helper functions and simplify the code. resolves #12 Sep 5, 2024
@safa-amin safa-amin changed the title refactored lines 46 to 70 to have helper functions and simplify the code. resolves #12 refactored lines 46 to 70 to have helper functions and simplify the code, src/messaging/rooms.js Sep 5, 2024
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