Quite a lot of modules use the "if higher X -> critical, if higher Y -> warning" idiom now, so extracted that into a common function for reuse. see #23