An even cleverer trick if you have lots of things you could inspect, but finite resources and you should like to encourage people to have practices that routinely pass inspection anyway:
The Paris MOU randomly inspects vessels entering European ports with the rate of inspections based on their flag. So if you're a UK registered ship, you might expected to go several years without inspection, while if you're Albanian registered, Albania is blacklisted, you're getting inspected twice a year or more, and if you fail several inspections you're getting banned from all European ports.
How did Albania get blacklisted? The Paris MOU tracks the results of inspections. Each time a ship flying some flag is inspected, the result of the inspection changes the calculation of how much apparent risk there is of ships with that flag failing inspection. Risk too high? Greylist. Risk higher still? Blacklist.
Why flags? Because before Port State Control existed, the Flag States (Country where the ship is registered) were responsible for periodically inspecting ships. And they still are, it's international law, the Europeans just got sick of all these ships with a "flag of convenience" from some distant island that are clearly non-compliant and have never been inspected in their nice well-regulated ports. So they invented the Paris MOU and Port State Control.
And it worked, I mentioned the UK flag is whitelisted, but the Bahamas are a famous Flag of Convenience, and they're whitelisted too, because they took the job seriously. A Bahamas registration is a little cheaper†, but your ship will be properly inspected on their behalf, and so sure enough when it gets randomly inspected again in say, Antwerp, it'll likely pass. Meanwhile St Vincent, another Flag of Convenience, is on the Greylist and a few tiny islands that dipped their toes in the "Flag of Convenience" business are blacklisted. The promise of inspectors poking around inside your ships every five minutes is a bad deal even if Tuvalu shipping registration is half price.
† The other thing we don't like about Flags of Convenience is they make it easier to hide who owns things, which can serve to also avoid taxation. The Paris MOU doesn't fix that, that superyacht registered in the Bahamas might be safe but the owner likely didn't pay tax...