In the US I do not know of any law that says you have to report a code violation but if you, as a professional, working on it, may have the obligation to fix it if you touch it. This all gets back to those "rehab" or "existing building" codes we talk about here.