Dishwasher electrical connection up to code?
For a hardwired appliance, either one of two things are true in order for the connection to comply with Code:


The appliance provides a junction box on itself where the field wiring connections can be made, or
The appliance provides a "whip" of cordage or wire-in-flex that has bare ends -- this is intended to be terminated in a field-installed junction box.


If it's the former, then the drywall damage is pure sloppiness (and wouldn't qualify as "neat and workmanlike" if you ask me -- some sort of LV bracket could be used for cable routing purposes I suppose?).  If your dishwasher does the latter (which is my suspicion), then you need to install a box and NM clamp for the cable (a surface mounted "handy box" would do, as would an old work box cut into the wall) and then use a faceplate with a knockout on the front along with a cable clamp or bushing to route the appliance whip into the box.