You’d think a based-on-a-true-story film starring the great Judi Dench as a proper British matron accused of being a longtime spy for the Russians would be a recipe for a crackling good thriller.

“Red Joan” will prove you wrong at every turn.

It’s almost fascinating how stultifying this movie is, given the premise and the above-the-title star — but “Red Joan” is a soapy, clumsy, maddeningly simplistic mess.

Also, most of Dame Judi’s scenes are quick and a criminal waste of her talent, as the bulk of the story takes place in flashback, with Sophie Cookson as the true lead, playing the young Joan.

Ms. Cookson is a capable actress. She is not Judi Dench.

“Red Joan” is based on a novel inspired by the life of Melita Norwood, who was a British civil servant from 1937 to 1977 — and a KGB intelligence source the entire time.

Whatever the realities of Norwood’s life, it must have been more eventful and harrowing and complex than this corny, shallow and sometimes sexist depiction of events, in which Joan is often portrayed as a starry-eyed fool who is so blinded by love, she commits insanely stupid and short-sighted acts of treason against her country.

The story opens with the elderly and utterly respectable Joan (Dench) opening her door one day to find police officers telling her she’s being charged with treason for leaking classified documents to the Russians.

What! That’s crazy!

Except …

“There’s a file on you,” she’s told, “starting in 1938, when you went to Cambridge University.”

Cue the first of many, many flashback sequences, which take up 10 or 15 minutes of screen time before we return to a quick glimpse of Dame Judi, who utters a line or two, and then flutters her eyes in one direction or another, indicating she’s about to have another memory and we’re going to return to the past.

In the late 1930s, young Joan is an innocent studying physics at Cambridge when she finds herself dazzled by the sophisticated Sonya (Tereza Srbova), who introduces her to the dashing Leo (Tom Hughes), a German Jew and a Communist organizer who actually calls Joan “my little comrade” when he kisses her before they tumble into bed.

Ooh, you seductive and dastardly Red Devil!

Back to Dame Judi, who confirms to authorities she attended a few meetings, but it was the “in” thing to do at the time, and she never took it seriously.

Old Red Joan’s eyes dart about. Flashback time!

By 1941, Joan has a job with the British government affording her access to their top-secret efforts to build a bomb at least as quickly as the Americans — and before the Germans can do it.

Once in a while, Leo shows up, and Joan swoons, what with Leo’s fantastically floppy hair and his bedroom eyes and his big talk. She also enters into another, equally stupid love affair, in between making big speeches to rooms filled with men.

“[Dropping an atomic bomb] will mean the deaths of hundreds of thousands of people!” says Joan.

“Don’t think like that,” says her boss. “We’re scientists. Leave the politics out of it.”

Lot of help he is.

And then we’re back to the future, with old Joan steadfastly maintaining her innocence, even though we see in the flashback scenes she WAS a spy for the Russians, not only during World War II but during the Cold War. Joan rationalizes funneling secrets to the Soviet Union by saying she was trying to save the world. If Russia also had the bomb, that would mean neither side would use it.

You gotta be kidding me, Old Red Joan and young Red Joan. You spent nearly your entire life betraying your country and living a lie based on THAT logic?

On top of that, at least as the story is told here, you were just about the dullest double agent in movie history.

‘Red Joan’

★★

IFC Films presents a film directed by Trevor Nunn and written by Lindsay Shapero, based on the novel by Jennie Rooney. Rated R (for brief sexuality/nudity). Running time: 110 minutes. Opens Friday at local theaters.