The city that I use to work at adopted the International Property Maintainace Code.
Section 605 ( Electrical Equipment ) in that section, Section 605.1 States, under Installation. Electrical equipment, wiring and appliances shall be properly installed and maintained in a safe and approved manner. I would think that the issues in the original post would be covered by this section and the installation would have to corrected to fix the hazards. The city also has a web site that people can report Property maintenance issues.
Thanks, Bill