Well, if there is an actual documented violation from the building authority it would, in theory, establish negligence per se. However, you don't provide many facts. Are you seeking to establish negligence against the person responsible for the building code violation, or someone else? An allegation of a building code violation would support an allegation of negligence per se, but you still have to prove your case against the person or entity defending the claim.
It could be if you were injured or harmed by the violation of the building code.
However, if the landlord harassed you out of the apartment, that in itself wouldn't constitute negligence per se.
Frank W. Chen has been licensed to practice law in California since 1988. The information presented here is general in nature and is not intended, nor should be construed, as legal advice for a particular case. This posting does not create any attorney-client relationship with the author. For specific advice about your particular situation, consult with your own attorney.