When New York City Police superstars Highsmith and Danson – a hilariously heavy-handed Samuel L. Jackson and Dwayne Johnson – make an unexpected exit from the department, it’s time for Gamble (who’d rather stay at his work station) and Hoitz to step awkwardly up to the plate.

The plot is pure McGuffin. It’s also way too convoluted, something to do with an investment scam masterminded by financial whiz David Ershon, played by Steve Coogan – who scores the least laughs here.

Others grab a bigger slice of the funny: Michael Keaton as the chaps’ captain who unwittingly speaks in TLC song titles; Eva Mendes as Gamble’s inexplicably hot wife; Ice-T as the story’s straight-faced narrator.

If anything, though, it’s Wahlberg who wins the class clown award, flexing his comedic clout by maintaining a subtle deadpan whether tackling ballet moves or staring incredulous at his partner’s good fortune with the ladies. Ace one-liners come his way, too: “I feel like we’re literally driving around in a vagina,” he says, ensconced in his partner’s highly unsexy red Prius.

As with the NASCAR races in Talladega, McKay brings a professionalism to the pyrotechnics (car chases, shoot-outs, loud bangs) worthy of a straight actioner.

It’s an approach that stops the film devolving into a series of Saturday Night Live skits; solid anchorage for all the random tangents and off-kilter riffs. Jokes are allowed to recur without wearing out their welcome.

And when the end credits pitch up, you realise both Ferrell and Wahlberg have kept their clothes on. Surprises? This movie’s full of ’em.