While doing home inspections in and around the San Fernando Valley, I have noticed on many occasions homeowners using extension cords outside in a manner that is a safety hazard.
First off, extension cords should be to temporarily plug something in, and not as permanent wiring. If you need permanent wiring outdoors, you should have a qualified and licensed electrician run proper wiring with proper weather resistant conduit.
Secondly, if you do use an extension cord outside, make sure you use an extension cord that is rated for outdoor use. Extension cords rated for indoor use only may easily wear, leaving wiring exposed or broken.
And finally, when using outdoor extension cords, or plugging into any exterior outlets, make sure the outlet is GFCI (ground-fault circuit interrupter). GFCI outlets have been required on all exterior outlets since 1996. Even if you think your outlets are grandfathered in, I still always highly recommend all exterior outlets be converted to GFCI for your protection and safety.
You will notice in the picture above, there is an extension cord being used as non-temporary wiring, that the cord is an interior cord instead of cord rated for outdoor use, and that is NOT plugged into a GFCI electrical outlet.