I've actually seen worse!! This looks like temporary wiring for a remodel...yeah, yeah that's it!
Stud is drilled too close to the face, box for switches not nailed, splices should be in a box and accessible. Staples are good enough for MOST inspectors.