This certainly violates some encoding standards, but does WP violate the encoding standard?
I would not have a job in an IF block condition. People will always be surprised, it should be == instead of = ?.
Refactoring is good to recover part of your technical debt. Unit tests and good code coverage make refactoring easier.
A good rule of thumb is when you touch the code (or have to look at it to decrypt it) that it is time for it to be reorganized, so the next person should not deal with it. In this case, you have reviewed the code, you must reorganize it. Of course, these are recommendations that the group should agree on.
Ideally, you should control your technical debt.
source share