This installation may have been Code-compliant at one time, but right now it has some serious problems. Section 406.9(A) requires 15A and 20A, 125V and 250V receptacles installed in wet locations to have an enclosure that is weatherproof when an attachment plug is either inserted or removed. Section 404.4 requires switches in damp or wet locations to also have a weatherproof enclosure. This enclosure is not weatherproof right now. The bubble cover has snapped off leaving the receptacles and switch exposed to the elements. Section 110.12(B) prohibits electrical equipment from having broken parts, such as this bubble cover, that may adversely affect the safe operation or mechanical strength of the equipment.
Perhaps this bubble cover, also known as an outlet box hood, broke because it was not rated as “extra duty” as required by Sec. 406.9(B)(1). One final concern is whether the receptacle is a weather-resistant (WR) type as required by Sec. 406.9(B)(1).