51

I keep seeing these posts that are mostly code wrapped by a few lines of text, aforesaid code being formatted terribly. If I try to improve their post and edit the code I get the error:

it looks like your post is mostly code; please add some more details.

Why can the original post contain more code than an edit? Shouldn't I be able to edit the post if I don't add or remove any code?

EDIT:
In response to David Heyman's comment on his answer, could we modify the filter to detect reformatted code in an edit? Or could the filter be more efficient in detecting code?

3
  • 52
    because the poor formatting gets it around the filter.
    – Kevin B
    Commented Oct 18, 2016 at 19:34
  • 3
    And even after formatting they are poor questions, either vote to close or downvote.
    – Dijkgraaf
    Commented Oct 20, 2016 at 17:43
  • @Dijkgraaf they aren't all poor questions, only most of them. The questions which one would feel tempted to edit are usually the questions that don't deserve to be closed. Commented Mar 13, 2019 at 4:00

2 Answers 2

21

If code is not formatted as code (indented, preceded by an empty line), the filter doesn't see it as code. Thus, the filter sees you replacing non-code with code, and the resulting edited post would show up as having too much code.

It's not a change in the limits - the filter just couldn't see it.

3
  • 3
    So should I ask for a filter change and retag the question 'feature-request' or 'bug'?
    – MD XF
    Commented Oct 19, 2016 at 21:24
  • @MDXF You could ask but I don't know if it'd get you anywhere. That would mean the filter would need to be able to actually parse posts for things that look like code, not just see the number of lines formatted as code. Might not be worth the work. And it would still need to keep out the case where someone actually did replace descriptions with a code snippet or added a code block that dwarfs the description.
    – Vivian
    Commented Oct 19, 2016 at 21:54
  • 12
    @MDXF Unless it was just detecting "this edit is purely formatting a large chunk of non-code-block into a code block, so ignore the too-much-code filter". That should be plausible.
    – Vivian
    Commented Oct 19, 2016 at 21:56
4

There is an easy fix to this. The filter should simply ignore the text-to-code ratio when someone is editing a question (unless it is their own question).

Then, after one makes an edit that is "mostly code," the question should be flagged by the system, and not required to be flagged by the users themselves. A human can then decide if the question is still valid.

Since the filter system occasionally misses non-indented code, and new users will inevitably post non-indented code, I see this as the only viable solution, unless we all want to live with the ******* frustrating alert it looks like your post is mostly code; please add some more details when editing a decent new-user question with improperly formatted code.

Not the answer you're looking for? Browse other questions tagged .