When a landlord rents an apartment, the conditions in the apartment have to meet a legal standard, which is called the warranty of habitability. Any conditions which do not meet this standard are violations of the warranty of habitability. These can include broken plaster, peeling paint, no or inadequate heat, and many others.
If there are bad conditions in an apartment, a tenant has several options. The tenant can report the violations to the Office of Code Enforcement. The tenant can, in certain situations, repair the violations and deduct the cost from the rent. The tenant can withhold the rent. This can be risky, since the landlord may bring a nonpayment proceeding, although the bad conditions can be a defense to the rent. The tenant can also bring an action for repairs against the landlord in Housing Court, called an HP action.
If a landlord gets notice that there are violations in the apartment, he should arrange to fix them as soon as possible. If violations are not corrected, there may be fines imposed, and the landlord may not be able to collect rent.