Hint: UF cable sandwich
Scroll down to see the answer
The use of UF cable on the exterior surface of buildings or structures is permitted by Sec. 225.10(18) and Sec. 334.10(3) of the NEC. If the cable is exposed to physical damage it must be protected in accordance with Sec. 225.20 and the requirements for service cables in Sec. 230.50(B)(1). The latter section permits the use of raceways such as rigid metal conduit (RMC), intermediate metal conduit (IMC), Schedule 80 PVC, reinforced thermosetting resin conduit (RTRC) or other approved means to provide protection for the UF cable. While UF in the photo is probably not installed in an area requiring it to have protection from physical damage, the installer could have done a better job of choosing a method of connecting it to the luminaire and the surface-mounted box. This cable is simply sandwiched between the luminaire mounting canopy and the edge of the box. This method of attachment violates Sec. 314.17(B) since the cable is not secured to the box. Pinched wires could become a shock and fire hazard. This method is also not the best way to keep moisture and rain out of the box, as required by Sec. 314.15.