RE: Steemauto - Free and unlimited automation service - Backend improved
Hi again! Nice to see you progress on your project.
Let's go for the review:
https://github.com/mahdiyari/steemauto/commit/4260162182d8f32dfc2d289cb4a9ea68bb99c2a5#diff-9c56083eadcd8694642106b02de3697fR80 => Your node server return inconsistent responses. You should always return JSON.
Why did you change that? The previous code was actually good!
https://github.com/mahdiyari/steemauto/commit/470ec0c4de6372781b7913c51f0609ddbfbd1cd4#diff-9c56083eadcd8694642106b02de3697fR9 => Hardcode this is not a great idea. You should use an environment variable.
https://github.com/mahdiyari/steemauto/commit/470ec0c4de6372781b7913c51f0609ddbfbd1cd4#diff-9c56083eadcd8694642106b02de3697fL8 => Don't keep dead code.
You should choose better names for those variables
Here you got a test issue
If params.weight
isn't a number then weight === NaN
weight <= 0
will be false
and if( wif && ... && weight)
will also be false ("test" && NaN
=> NaN
)
https://github.com/mahdiyari/steemauto/commit/855b3808ba69d68a9a8e25e3a7b944d129c1b42a#diff-9c56083eadcd8694642106b02de3697fR49 => Why are you not using the dot notation ?
result.active_votes
. It happens in other places too.This is so useless :D
https://github.com/mahdiyari/steemauto/commit/8d16d5f11e415b2bb78bf1318869235641b6ec3d#diff-9ff16e90494c6fee051a43baebe037c2R18 => Why are you declaring this variable outside of the function's scope? Declare it inside the function and avoid the incrementation that's ugly ;)
delay3 = delay3 - 1
=>delay3 -= 1
? no?
Why are you not choosinguserFanBase
as a variable name instead of those weird increment. The dev has to find the declaration to see the comment and understand what the variable contains.You're still using
var
https://github.com/mahdiyari/steemauto/blob/8d16d5f11e415b2bb78bf1318869235641b6ec3d/nodejs/commentup.js#L103 => Should use
fetch
orwhatwg-fetch
https://github.com/mahdiyari/steemauto/blob/8d16d5f11e415b2bb78bf1318869235641b6ec3d/nodejs/commentup.js#L113 => Prefer template notation
Don't keep console.log that are meant for debug.
Why the same values?
I'm a bit disappointed by this contribution. I've seen better code coming from you. But you're improving overall so that's great!
Good luck for your next contribution.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Hey @gregory.latinier
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.
Contributing on Utopian
Learn how to contribute on our website.
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!
These codes are old! You reviewed old codes :p
I actually worked on 2 files
Trail.js and upvote.js
I reviewed the code of the 5 commit links if I'm not mistaken. So I review all the file not only the commit :)
yes, thanks, other changes are in progress! I can't rewrite all codes in one post. that will take some time!
I just applied StandardJS auto fix (removing semicolons) to the other files.
Also, that .json is for express servers and in this case that is not expressjs