A factory, alleged to be the source of an ongoing odour issue, breached or failed to comply with the terms of its environmental permit 40 times in the last five years.