The code should be something pleasant to read, something meaningful and with test cases, if is too big should be shortened, if it does too much, should be split in sub-functions/classes and should do only one thing.
No rule is written in stone, but reading good practices should give you a great place to start and make a better judgment