There’s a really funny R-rated buddy-cop movie starring Michael Peña as a reckless law-enforcement officer. It’s called “War on Everyone,” and it co-stars Alexander Skarsgard. You should see it!

There’s also “CHIPS,” a significantly less funny though still watchable buddy-cop movie starring Peña and Dax Shepard as motorcycle-riding California Highway Patrol officers. It has the same title, punctuation notwithstanding, as “CHiPs,” a 1977-83 TV series, but I assume that’s a coincidence, as they have almost nothing else in common.

In this version, Shepard — who also wrote and directed — plays Jon Baker, a banged-up former motorcycle racer who now chews pain pills like candy and has just become a CHP officer in sunny Los Angeles. He’s partnered with Frank “Ponch” Poncherello (Peña), a federal agent working undercover as a CHiP to investigate a series of armored-car robberies that might have been perpetrated by crooked L.A. cops. (Not to spoil who it might be, but Vincent D’Onofrio is also in the cast.)

Jon’s an eager rookie who wants to do everything by the book and earn back the respect of his shrewish wife, Karen (Kristen Bell, Shepard’s real-life spouse). He doesn’t know that Ponch, a loose cannon, is a Fed with a secret agenda who’s interested only in pursuing his investigation and not, for example, in doing everyday CHP work. Jon is touchy-feely and enlightened (always “three beers too intimate,” Ponch calls him); Ponch is insensitive, grossed-out by male affection or physical closeness. The movie keeps coming back to this subject, one of Shepard’s personal fascinations. Is it “homophobic” for Ponch to refuse to hug a man clad only in underwear? How much skin-on-skin contact is acceptable before it becomes “gay,” and why is that a problem? The returns on this topic diminish considerably before Shepard is finished with it, I can tell you that.

Anyway, things shift about midway through the film, when Ponch finally fills Jon in on the federal investigation and they start working together on it. It’s a good development that should have come sooner: there is much more fun to be had in opposite-but-partnered characters having the same goal than there is in an odd couple working on different agendas. These versions of Ponch and Jon are cluttered with extraneous quirky personality traits — besides what I’ve already mentioned, Jon is overly sensitive to smells, and Ponch is a sex addict and compulsive masturbator — but this gives the film a pleasant unpredictability. It follows the formula of the buddy-cop action movie, but it’s peppered with detours and Seinfeldian conversational tangents that vary widely in quality but at least keep things from feeling too familiar.

Michael Peña’s casual disregard for social norms is the movie’s most consistent pleasure, followed closely by a running gag about his tense relationship with his former partner (Adam Brody). Shepard’s obsession with cars and motorcycles pays off in the action scenes, an example of a filmmaker’s personal interests making him a good fit for the material. At the other end of that spectrum is a glaringly out-of-place gag about paparazzi, one of several purely self-indulgent touches that make you think, C’mon, Dax. That’s not what grown-ups do when they make real movies for big studios. “CHIPS” is uneven in that way, veering from scathing humor to patience-trying nonsense and back again, but it winds up just barely on this side of the thin blue line between good and bad.

B- (1 hr., 40 min.; R, pervasive harsh profanity and vulgar dialogue, some nudity, some strong violence.)