Believe it or not there is a section in the national electrical code that states that poor craftsmanship is a violation. Poor craftsmanship can also force other trades to compromise their level of craftsmanship in order to work around poorly installed work. When you can see that someone did not care about their work on a cosmetic level then more often than not, worse things are hiding out of plain sight.
Although most people know extention cords are not the right way to solve an electrical problem, it is something that is found more than you would expect. The circuit breaker in your electrical panel is sized according to the gauge of wire it protects. When an extension cord is added to a plug they are more often than not a much smaller gauge than the breaker is intended to protect. This can lead to excess heat and in some cases even fire.
An open splice.
An open splice is an uncontained electrical connection. Typically a box will enclose this wiring in case a wire were to spark, the box that surrounds the connection will contain that spark. When we come across this we can assume that: 1) the person doing the electrical work before us didn't care or 2) the person that worked on this wiring had no clue what they are doing. Both of which are a warning sign that other electrical problems are most likely present.