-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
return instead of else. As an example:
rerum_server_nodejs/routes/patchSet.js
Lines 10 to 17 in 2f43bb8
| if (rest.checkPatchOverrideSupport(req, res)) { | |
| controller.patchSet(req, res, next) | |
| } | |
| else { | |
| res.statusMessage = 'Improper request method for updating, please use PATCH to add new keys to this object.' | |
| res.status(405) | |
| next() | |
| } |
prefer the use of guard clauses where efficient and clear. Only assign results to a variable if they are needed later.
Copilot