That's something that readers need to determine on their own, and can vary on a case by case basis. You simply need to use your own judgement.
Sometimes the person asking the question is under constraints that others aren't, or that may seem very unusual or suspect to you, but sometimes there really is a reason for the constraints, even if they aren't explained. Sometimes something that seems bad when looked at in isolation really is appropriate when looking at the larger context.
In other cases a refactor of the entire code base may be considered as simply out of scope of the question. Something that might be mentioned in a comment, but that wouldn't require an answer to address.
You need to take into consideration the possibility, and probability, that there's a good reason for what's being done, consider the cost or problems with not fixing it (i.e. leaving a SQL injection vulnerability is very serious, and I personally would downvote an answer for not addressing it; leaving poor variable names isn't terrible, and I wouldn't downvote for not changing it, but fixing them is still nice), consider the cost of the refactor, and whether your refactor is distracting from the real answer to the question or enhancing it.
Another option to consider, in some cases, is mentioning the problem without actually fixing it. State at the end of the answer that some section seems much less efficient than it could be, or that the variable names are unclear, or that using such and such a construct isn't encouraged. This ensures that these side issues don't overwhelm the body of your answer and detract from the actual question while giving the OP the opportunity to address the potentially worrisome practice. You can always expand on such a section in the event that there are comments about such a notation.
There will be cases where one option or the other is better, cases where people disagree, cases where either is acceptable, and so on.
As I said before, just use your best judgement, and use the feedback that you get from the community (in the form of both comments and votes) to help you.