I think @lionel-rowe built Unformatted Code Detector theme component for this.
Your mileage will vary here cause it depends on regexes and may have false positives / negatives, but I am sure it could be a reasonable starting point if you have a pathological issue.