Each state has its own housing and building codes that serve different purposes and functions
Housing Code
The housing code comprises state and local laws that legally require property owners and landlords to maintain their properties up to code and ensure that they are kept tenant-habitable.
In California, for example, with each property lease, there exists an implied covenant that the landlord or owner of the property promises to deliver to the tenant a habitable and safe property and warrants the tenant will have the quiet enjoyment of their premises.
Building Code
Building codes specifically contain regulations concerning the design and construction of buildings. Building codes are enacted to protect the general public from health and safety dangers caused by improperly constructed buildings.