It is a basic NEC requirement and common-sense notion that electrical splices and terminations are to be housed in an enclosure. The enclosure prevents ignition of nearby combustible material in the event of arcing at the wire connection point. Additionally, the enclosure protects splices and terminations from physical damage. The bottom line is that along with overcurrent protection, enclosures are highly effective in assuring that an installation will not result in the twin demons of electrical fire and electric shock.
To be effective, enclosures must be chosen and installed correctly. And, as usual, when it comes to electrical safety, the NEC is the definitive guide. Here are some Code violations where enclosures were improperly chosen or installed incorrectly.