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/user/delete.js #572

Open
wants to merge 3 commits into
base: f24
Choose a base branch
from
Open

Conversation

emshyu
Copy link

@emshyu emshyu commented Sep 5, 2024

resolves #474

To reduce function nesting that is greater than 4 levels, I refactored the updateCount function. I moved an inside lambda declaration outside and declared it as a separate helper function. This change results in 4 levels of nesting. I also added assert statements to test the correctness of the helper functions.

Tested in UI by creating, and then deleting a user. I verified that follower counts were updated and the console.log message showed.

Copy link

sonarcloud bot commented Sep 5, 2024

@coveralls
Copy link

Pull Request Test Coverage Report for Build 10729816030

Details

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 82.675%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/user/delete.js 1 2 50.0%
Totals Coverage Status
Change from base Build 10607818019: 0.004%
Covered Lines: 22324
Relevant Lines: 25582

💛 - 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.

Refactoring code in src/user/delete.js
2 participants