In California, landlords are legally required to make sure all units in all residential buildings they own meet certain minimum standards for safe human habitation, including but not strictly limited to:
Functioning plumbing, including both hot and cold running water
Functioning locks on doors and windows
Sufficient heat
No insect or rodent infestations
Properly kept trash receptacles
Public stairwells, flooring, and lighting in good working order
No mold or moisture buildup
Functioning and safe electrical wiring and outlets