Talk about a split personality.

If I broke down “The Secret Life of Pets” scene by scene, about half the sequences would get a rating of three and a half stars, while the other half would be one-and-a-half-star material at best.

So. This is a two-star movie with moments of sheer exuberance and clever good fun — but just as many scenes that had me tilting my head like a dog trying to figure out what the WHAT is taking place before his very eyes.

Example. About halfway through the movie, our hero dogs Max (Louis C.K.) and Duke (Eric Stonestreet) stumble upon a sausage factory in Brooklyn. (Hey. These pets have secret lives.) What follows is a trippy detour involving dancing and singing tubes of meat — and a visual and musical homage to a very popular musical from nearly 40 years ago.

Not only will zero percent of the children in the audience get that reference, I’d say maybe a quarter of the adults will understand it — and most of them will be asking, “Why?”

Also, this isn’t exactly the sweet and cute and utterly kid-friendly movie you might expect it to be. Sure, there are wonderful vignettes sure to ring true with pet owners everywhere — but “The Secret Life of Pets” is also downright menacing at times.

SPOILER ALERTS!

Alley cats hiss and bare their claws and attack innocent pups. A giant viper and a voracious alligator are among the scary creatures prowling the sewers of New York. One of the dogs rounded up by Animal Control is outfitted with a mask that brings to mind Hannibal Lecter.

Oh. And one human character is killed off with a casual shrug of the plot.

One moment your little one will likely be giggling with delight. The next, you might find yourself explaining why a vicious villain is squealing with glee when he’s told a couple of pets have killed their owner.

“The Secret Life of Pets” is essentially the first “Toy Story” reimagined with cats and dogs (and other assorted pets).

Our narrator is a shorthaired terrier named Max (voiced by Louis C.K., who sheds every inch of his cynical sad-sack persona and does a great job of conveying, well, a dog). In the opening montage, Max tells us all about his blissful life with his human, the lovely and sweet Katie (Ellie Kemper).

As Max tells it, he and Katie have the greatest time — but every morning, she just LEAVES him. Where does she go? Why does she do that?

Oh well. At least Max has his friends to keep him occupied until Katie returns. There’s a Pomeranian named Gidget (Jenny Slate) who lives across the way and is madly in love with Max; the blimp-shaped fat cat Chloe (Lake Bell); a not-very-bright but likable pug named Mel (Bobby Moynihan); and other assorted pets, all of whom can converse in English once their humans are out of the picture.

Max has quite the perfect life — until the night when Katie comes home with a huge rescue mutt named Duke (Stonestreet) and tells him Duke is his new “brother.”

Rivalry on.

The battle between Duke and Max leads to both of them stranded on the streets of New York, stripped of their identifying tags and pursued by Animal Control and a rogue group of “Flushed Pets,” who have been abandoned by their owners and are staging a revolution to free all animals from their humans. (No. Really.)

The leader of the movement is a mean and slightly crazy little bunny named Snowball, who worked with a magician for 10 years until “rabbit out of the hat” routines lost their appeal. Snowball is voiced by Kevin Hart, and he’s funnier here than in any live-action movie role he’s had in recent memory.

Also adding spark: Albert Brooks as Tiberius the hawk, who must suppress his appetite so he can learn to get along with other creatures, and Dana Carvey as Pops, an elderly basset hound who gets around in one of those dog wheelchair contraptions and is “connected.” Carvey sounds like he’s channeling Lionel Barrymore’s Mister Potter from “It’s a Wonderful Life,” and he scores perhaps the film’s biggest laugh with a joke about his advanced age.

Speaking of scores: Alexandre Desplat’s bouncy, 1960s-sounding music is annoying overkill. When there’s a chase sequence or some other type of romp, we don’t need “romp music” telling us it’s a romp. We’re already romping.

One of the things the movie gets right is the matchup of humans with their animals of choice. From the Cat Lady to the elderly owner of a very old dog to the guy who has a hawk, the people and their animals (or the animals and their people) are well matched.

The movements of the animal characters are also spot on. A pup circling around before settling into his blanket; dogs distracted by butterflies and bouncing balls; a cat using a mouse as a plaything. Great stuff.

“The Secret Life of Pets” also has fun with the behavior of the humans, including a dog walker who pays very little attention to his job.

But there’s too much dark, even mean-spirited cynicism. And the ending isn’t nearly as heartwarming as it could have been because the writers and co-directors opted not to go with a certain (and seemingly pretty obvious) dramatic choice.

Even though I’m not recommending “The Secret Life of Pets,” I wouldn’t mind seeing a sequel. The main characters deserve another at-bat.

★★

Universal Pictures presents a film directed by Chris Renaud, co-directed by Yarrow Cheney and written by Cinco Paul, Ken Daurio and Brian Lynch. Running time: 90 minutes. Rated PG (for action and some rude humor). Opens Friday at local theaters.