Right... And the 4th Amendment only applies to CRIMINAL LAW...
Code violations are more often than not civil infractions and 4th Amendment protections do not apply as far as civil and administrative law violations go -- any enforcement official who has powers of arrest and seizure would need to obtain a warrant to enter any premises they were not invited into by the person lawfully in control of said premises...
Now the gray area is where the code officials bring along police officers as "protection" when they enter a premises involuntarily... Since the police officer is there only as a protector for the code official the police officer is * NOT * allowed to search anything -- but if you leave criminal contraband (or evidence that something illegal was present) then that is in plain view and the officer can place you in custody while a warrant is obtained to further search the premises...
~~ Evan