Is this wiring up to code and safe?
By code the sheath of the romex should be 1/4" inside the box. The open junction behind the new box or the original box what looks to be just conductors running to the new box would also be a code violation. To bring this up to code A cover plate with holes and clamps wounded be needed on the old box then short pieces of romex with the sheaths entering the boxes 1/4" would meet code requirements. If there is not enough room for all the splices a box extension on the old box could be used some box extensions have knockouts on the side this would be easier to wire and clamp than clamps on the cover if the space in the old box is tight.