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

Refactor src/topics/unread.js #15

Closed
wants to merge 2 commits into from
Closed

Refactor src/topics/unread.js #15

wants to merge 2 commits into from

Conversation

Tasnim1147
Copy link

@Tasnim1147 Tasnim1147 commented Aug 30, 2024

Refactored the getTids function to reduce function nesting to no more than four levels deep.

Changes Made:

Improved readability by implementing the areTagsAllowed and shouldIncludeTopic functions. The areTagsAllowed function now uses a for loop instead of .every(), and the shouldIncludeTopic function uses conditionals and areTagsAllowed function to reduce nesting level.

@coveralls
Copy link

coveralls commented Aug 30, 2024

Pull Request Test Coverage Report for Build 10628550285

Details

  • 6 of 12 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 82.655%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/topics/unread.js 6 12 50.0%
Totals Coverage Status
Change from base Build 10550029021: -0.02%
Covered Lines: 22328
Relevant Lines: 25592

💛 - Coveralls

@Tasnim1147 Tasnim1147 marked this pull request as draft August 30, 2024 06:39
Copy link

@Tasnim1147
Copy link
Author

Tasnim1147 commented Aug 30, 2024

The new issue by SonarCloud suggested using optional chaining, but the nodeBB uses [email protected], which does not fully support optional chaining.

Setup:

For more details, see this Stack Overflow post discussing optional chaining support in ESLint.

@Tasnim1147 Tasnim1147 marked this pull request as ready for review August 30, 2024 07:55
@Tasnim1147
Copy link
Author

Addresses #14

@Tasnim1147 Tasnim1147 closed this by deleting the head repository Sep 11, 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