In some areas of the country it is common and customary for municipal authorities to require a Certificate of Occupancy (CO) whenever a property is conveyed to a new owner. In Bethlehem, PA, the City requires a clear CO each time a property is rented to a new tenant. A "clear" CO is one that is free of violations (e.g. healthy and safety, electrical code, fire, etc.)
Some municipalities require that all violations be cleared before anyone is allowed to live in the property. These restrictions are being challenged as unreasonable detriments to the sale process. In some areas, new property owners have 30 days to a year to remove conditions that result in violations.