It's a very difficult question to answer. "Rules/laws" covers a wide spectrum and it may be inappropriate to enforce all rules at all times. That decision would come down to the judgement of the arbiter and the application of "mitigating factors".
In a criminal or civil proceeding, the judge would be that arbiter.
One of the problems is that the codes of law are so complex that it's very difficult to dot all the i's and cross all the t's, and loopholes can often be found. Those loopholes, which undermine the spirit of the law in favour of its rigidity, are no less the law and are equally deserving of being enforced.
Or course, when you find aberrations like drunk Ethan Couch, "the affluenza teen" being freed by a retiring judge after killing four people, the stench of corruption is very strong. https://en.wikipedia.org/wiki/Ethan_Couch