I think some code-only answers are not that bad. It depends on what the question is. If, for example, someone is asking:
how can I code such a task?
How is a code-only answer incomplete? It is as complete as an answer that only adds: "Here's the answer", "I think you need this:" or any other variant of this phrase to the code.
It is true that we might want some explanation behing the code, but, IMHO, if not specified otherwise in the question, code-only answers are acceptable as well.
You can always post a comment to require more out of an answer, but I think downvoting or, even worse, flagging is an exaggeration.