clean-code-javascript icon indicating copy to clipboard operation
clean-code-javascript copied to clipboard

Function should only do one thing - Invalid example

Open atlanteh opened this issue 6 years ago • 4 comments

Checking the db for "isClientActive" would likely return a promise, and this makes clientRecord.isActive always return false since clientRecord is actually a Promise which doesn't have isActive prop.. But even if fix that.. When we filter by this function for active clients we will get all record since this function returns a promise which evaluates to true when filtering

atlanteh avatar Dec 05 '19 06:12 atlanteh

Feel free to open a PR fixing this! Thanks!

ryanmcdermott avatar Jan 10 '20 21:01 ryanmcdermott

Want to know if this is still an issue..?

anshul2807 avatar Aug 19 '21 18:08 anshul2807

@anshul2807 I haven't fixed this. I see the issue is still in there

atlanteh avatar Aug 23 '21 10:08 atlanteh

ok , I'm working on this issue.

anshul2807 avatar Aug 23 '21 10:08 anshul2807