All references are based on the 2017 edition of the NEC.
Improvised Failure
It appears this installer improvised his wiring method to complete this job. Instead of using an approved Chapter 3 raceway or cable wiring method, he simply placed some single conductors in a plastic cord covering, which ran from fixture to fixture.
Section 110.8 tells us that only “suitable” wiring methods are recognized in the Code. This is not one of them! Section 310.10 states that single conductors, such as the types used for this installation, must be installed in a Chapter 3 wiring method. Using MC cable, EMT, or surface metal raceway would have been a much better choice. The way in which the conductors enter the fixture could really lead to a short circuit or a ground fault because the sharp and jagged edges of the hole drilled through the metal could easily cut right through the wire’s insulation. Section 410.48 requires wiring on or within luminaires to be arranged so they are not exposed to physical damage. In addition, Sec. 410.56(B) requires wires passing through metal to have their insulation protected from abrasion where they pass through metal.
I would say this installer failed in his attempt to follow the intent of these rules. Improvising installations can be done safely only if the Code rules are followed.
Little Shop of Electrical Horrors
There are a lot of problems to point out here. The most obvious one is the lack of working space in front of this panelboard. The shop owner installed those shelves in the exact spot where an electrician would need to stand to work safely on this energized panelboard. This is a violation of Sec. 110.26(A), which requires a minimum depth of 3 ft, a minimum width of 30 in., and a minimum height of 6½ ft be kept clear in front of the panelboard. Section 110.26(B) clearly states that this working space cannot be used for storage, yet unfortunately many electricians must deal with this violation on a regular basis. At least the door on the panelboard cover was left open; otherwise, the breakers would not have been accessible without removing the cover.
Another problem is the lack of connectors and supports for the NM cable entering the wireway. Section 300.11 requires cable assemblies to be securely fastened in place. Section 334.30 requires NM cable to be secured within 12 in. of the cable entry into the wireway. This cable is simply shoved into an opening with no connectors or staples to protect or secure it. The unused openings in the wireway must also be closed to comply with Sec. 110.12(A).