"Would anyone be interested in joining a class action lawsuit against the city for failure to enforce codes? If so, please e-mail me at email@example.com."
I have no idea about the form this lawsuit might take. One possibility, is a writ of mandamus. Our friends at Wikipedia define the writ as follows:
"A writ of mandamus or simply mandamus, which means "we command" in Latin, is the name of one of the prerogative writs in the common law, and is issued by a superior court to compel a lower court or a government officer to perform mandatory or purely ministerial duties correctly. Mandamus is a judicial remedy which is in the form of an order from a superior court to any government, subordinate court, corporation or public authority to do or forbear from doing some specific act which that body is obliged under law to do or refrain from doing, as the case may be, and which is in the nature of public duty and in certain cases of a statutory duty. It cannot be issued to compel an authority to do something against statutory provision.
Mandamus can be supplemented by the statement that it is not only the command to do but also a command not to do a particular thing against the rights of the petitioner. Mandamus is supplemented by legal rights. It must be a judicially enforceable and legally protected right before one suffering a legal grievance can ask for a mandamus. A person can be said to be aggrieved only when he is denied a legal right by someone who has a legal duty to do something and abstains from doing it."
You can read more about writs of mandamus by clicking here.I have also read on the Internet of suits by homeowners against particular individual landlords to enjoin the operation of a group home in violation of zoning codes. In the case of protected classes, this probably would not work, however, if the renters were just adults who grouped together to rent a single family home, the landlord might find him/herself holding the short end of the stick.