As he recounts the rise and collapse of the gangster rap group N.W.A., beginning in 1986, director F. Gary Gray clearly intends to use the ensemble’s experiences as a vantage point for a larger critique of society as a whole.

Unfortunately, Jonathan Herman and Andrea Berloff’s script nibbles at the edges of the art form’s assumptions, but never fundamentally challenges them.

The story focuses primarily on the two members of N.W.A — Ice Cube (played by the rapper’s son, O’Shea Jackson Jr) and Dr. Dre (Corey Hawkins) — who went on to have headlining solo careers, as well as on Eazy-E (Jason Mitchell), another founder whose life took a different turn. This trio’s goal, shared with collaborators DJ Yella (Neil Brown Jr.) and MC Ren (Aldis Hodge), is to translate the frustrations of growing up in the Los Angeles-area ghetto of the title into popular protest music.

Controversy dogs them, based largely on the perception that some of their lyrics call for attacks on the police.

The nature and legitimacy of N.W.A’s actual stance is open to debate. But there’s no getting around the fact that cops are relentlessly demonized in the film.

The movie’s outlook on violence in general, at least of the retaliatory sort, is ambiguous at best.

In an earlier scene, giddy fun is made out of an armed confrontation between the freewheeling womanizers of N.W.A. and some rivals for the affections of the ladies they’re currently entertaining in a hotel suite. Not only is this interlude needlessly explicit, it also serves to reinforce the picture’s overall misogyny, under the terms of which women’s body parts are far more prominent than their personalities.

A more critical treatment of the ethically impoverished worldview that permeates the music it celebrates would have made this sometimes flavorful slice of pop culture history endorsable for at least a few mature viewers. And including a line or two of dialogue not weighed down with an obscenity would have helped as well.

The film contains flawed morality, some harsh violence, strong sexual content, including brief but graphic casual activity and full nudity, drug use, several instances of profanity and pervasive rough and crude language. (O, R)