Ukip could cost Labour victory in next year’s general election by winning several key seats thanks to dramatic advances made by Nigel Farage’s party in a range of largely working-class constituencies. The most detailed analysis yet of Ukip’s performance in recent ballots, including those for this year’s European Parliament and local elections, allied with the latest census data, concludes that complacency in Labour ranks over the Ukip threat could be a major factor in Ed Miliband’s battle for Downing Street.

With the party appearing more vulnerable to the anti-EU party than previously thought, MPs identified as most at risk from the dramatic Ukip surge in recent months include Gloria de Piero, a rising star of the Shadow Cabinet.

Even the loss of a few seats to Ukip would be a major setback for Labour – polls indicate a hung Parliament is a likely outcome in next year’s election as both main parties struggle to gain momentum for outright victory. Dr Matthew Goodwin, a leading expert in Ukip’s rise, has identified five Labour constituencies particularly vulnerable to Mr Farage’s insurgency, fuelled partly by disquiet over immigration levels. They are certain to be on a 30-strong hit-list which Ukip will pour its resources into at the election.

Download the new Independent Premium app Sharing the full story, not just the headlines

Dr Goodwin’s study contradicts the assumption among some Shadow Cabinet figures that a leap in backing for Ukip at the election will help Labour by hitting the Conservatives disproportionately hard.

Dr Goodwin, associate professor of politics and international relations at the University of Nottingham, identified the Great Grimsby constituency of being at the greatest risk of falling into Ukip hands next year. He found that Ukip has gone from “strength to strength” in the Lincolnshire town, winning 41 per cent of the vote in this year’s elections – 18 points ahead of Labour – and displaying the “ideal demographics” to respond to the party’s appeal.

Its well-known MP, Austin Mitchell, will be stepping down next year after 37 years in parliament, depriving Labour of the “incumbency factor”.

Ukip could also have a good chance in Ashfield, Nottingham, the former mining constituency represented by Ms De Piero, the shadow minister for Women and Equalities. She scraped in with a tiny majority in a seat where the vote was widely split with the Tories and Liberal Democrats in 2010.

Although Ukip performed weakly there four years ago, it has bounced back to win the most votes in May and, according to Dr Goodwin, is “helped by a tradition of anti-Labour voting in the seat, which has disrupted old loyalties”.

Ms de Piero said: “We are working for every vote in Ashfield and we’ve knocked on doors each week since the last general election.

Inside Politics newsletter The latest news on Brexit, politics and beyond direct to your inbox Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive updates on politics every morning by email Update newsletter preferences

“We are a former mining community and we remember what Thatcher did to our pits, so I will be campaigning against Ukip because we don’t want a party led by a man who wants to ‘keep the flame of Thatcherism alive’ in Ashfield.”

Labour has hardened its message on immigration since the European elections, although it insists it will never resort to Ukip’s alleged xenophobia in blaming foreigners for Britain’s problems.

The shadow Chancellor, Ed Balls, said this weekend that he backs “fair movement, not free movement” for European Union citizens coming to this country.

Meanwhile, Rachel Reeves, the shadow Work and Pensions Secretary, said that a Labour government could withhold out-of-work benefits from EU migrants until they have paid into the system through National Insurance. “It isn’t right that somebody who has worked hard all their lives and has contributed to the system is entitled to only the same as somebody who has just come to this country, so we need to look at that,” she said.

Other parties are making similar moves. The Liberal Democrat leader, Nick Clegg, will also use a speech tomorrow to toughen his language on migration as he acknowledges many voters “have lost faith in Government’s ability to manage the flow of migrants from new EU states”.

He will argue that some future new EU members should be made to wait for more than the current limit of seven years before their citizens gain the right to work in this country.

The continuing impact of Ukip’s success on the Tories will be underlined on Wednesday when the London Mayor Boris Johnson is expected to conclude that quitting the EU is “definitely a viable option” for the capital and better than staying in an unreformed EU.

Other at-risk constituencies include Plymouth Moor View – situated in a more working-class part of the Devon city, and held by Alison Seabeck for Labour by 1,588 votes at the election – and Dudley North, where Ukip has a strong local branch and outpolled Labour by 12 points in this year’s local elections.

Dr Goodwin also predicted a concerted effort by Ukip in Rotherham, an historic Labour stronghold where the anti-EU party is established as the second political force.

It came second in a 2012 parliamentary by-election in the South Yorkshire constituency and took more than 40 per cent of the vote at the local elections, capturing 10 council seats and finishing a close runner-up in the other 11.

Some senior Labour figures are arguing for a low-key response, believing a strong Ukip performance will help Labour by depriving the Tories of votes. Others are pressing for a more aggressive stance because of Ukip’s inroads into Labour’s core support.