Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
P1B: Starter Task: Refactoring PR
Use this pull request template to briefly answer the questions below in one to two sentences each.
Feel free to delete this text at the top after filling out the template.
1. Issue
Please provide a link to the associated GitHub issue:
#163
Full path to the refactored file:
src/user/follow.js
What do you think this file does?
I think that this handles the following system in NodeBB, similar to a social media site.
What is the scope of your refactoring within that file?
I dealt with the export function
Which Qlty‑reported issue did you address?
Function with many returns (count = 9): exports
2. Refactoring
How did the specific issue you chose impact the codebase’s adaptability?
The more return statements there are the harder it becomes to debug when there is a problem
What changes did you make to resolve the issue?
I some logic that was duplicated in the function.
How do your changes improve adaptability? Did you consider alternatives?
In the future if there are bugs it will be easier to debug.
3. Validation
How did you trigger the refactored code path from the UI?
I just put it in so whenever there is a follow it should log my name.
Attach a screenshot of the logs and UI demonstrating the trigger.
I forgot my login for NodeBB, so I can't test if it works
Attach a screenshot of

qlty smells --no-snippets <full/path/to/file.js>showing fewer reported issues after the changes.