If there is a code violation at your unit, try contacting your landlord first (if it is safe for you to do so). It is a good idea to request the repairs in writing, so that you will have documentation of your efforts to communicate with your landlord.
If the code issues are not resolved, contact the Department of Buildings & Regulatory Compliance by phone at (518) 434-5995 or by email.