Luka967 / OgarII

FOSS implementation of a private Agar.io gameserver, made with Node.js.
Other
67 stars 38 forks source link

#BadCode #13

Closed SuperOP535 closed 6 years ago

SuperOP535 commented 6 years ago

https://github.com/Luka967/OgarII/blob/28939eafa8021d5671d9a09be4ba0fb139b8720a/src/sockets/Listener.js#L47

Why split when JSON supports array https://github.com/Luka967/OgarII/blob/28939eafa8021d5671d9a09be4ba0fb139b8720a/src/sockets/Listener.js#L49

Why loop when there is Array#includes? https://github.com/Luka967/OgarII/blob/28939eafa8021d5671d9a09be4ba0fb139b8720a/cli/index.js#L9

Did you know that JavaScript natively supports pretty-printing JSON? https://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript

I'd happily make a PR but you said you made some local changes so I don't know..

SuperOP535 commented 6 years ago

luka confirmed that these have been fixed and are waiting for push