If you read any political commentary over the last few weeks, you probably heard that Arizona Sen. Jeff Flake has problems. He’s in a feud with a president from his own party. His primary challenger led him in a recent poll. He may have trouble winning the general election in 2018 (if he makes it that far). His state has a large and growing Hispanic population -- which makes it a constant target for Democrats. The list goes on.

So how much do these problems matter? Is Flake really in danger of losing his seat? It’s hard to answer these questions this far out from the midterms and with the little polling available. But we can get an early assessment of the race by looking at his advantages, his disadvantages and how much power he has to change each aspect of his situation. Specifically, I’m going to examine Arizona’s state-level politics, Flake’s own political choices and “the Trump effect.”

Arizona Demographics -- Out of Flake’s Control, But Not a Huge Problem for Him

Flake has a number of very serious problems, but we'll begin with his home state -- a frequently overblown issue for the senator.

According to conventional wisdom, part of Flake’s problem is that he represents a quickly changing state. Arizona’s Hispanic population is growing and the vast majority of residents live in large metro areas. Democrats typically win Hispanics by wide margins and perform well in large cities, so some observers have drawn the conclusion that it's dangerous to be a Republican in the Grand Canyon State.

But the facts don't yet match the conventional wisdom. To see this, simply look at the state's long-term voting trend.

This graphic shows the national popular presidential vote margin, the Arizona popular vote margin and the difference between the two since 1916 (note that lead is calculated as the difference between Republican and Democratic two-party vote share). The latter is signified by the red line -- points farther above the horizontal axis indicate a greater Republican lean in that year, while points below that axis indicate that the state leaned to the left. Arizona's partisanship has changed significantly over time. It initially leaned right, pulled left during the New Deal era, swung sharply to the right when Eisenhower entered the political arena and, to varying degrees, has stayed right since then. The story of these shifts is long and complicated, but migration from the North to the South after the Second World War, the spread of air conditioning and broader partisan realignments all played a role.

Since its Republican zenith in 1980, the state has become less red. But the trend is less sharp than many have reported. In 2016 the state leaned six points more Republican than the nation -- similar to the state’s lean in 1996, 2000 and 2004. In 2008 Arizona voted much more conservatively than the nation, but that might have been due to John McCain's home state advantage there. Donald Trump’s performance does represent a real decline from Mitt Romney's (who outperformed Trump in large cities and may have had a large advantage with Mormon voters), but the point here is that Arizona isn't blue yet and the trend line isn't as clear as it is in a state like Virginia.

That's not to say that Arizona will definitely be out of play in the next cycle or that it won't elect a Democratic senator in 2018. The large shift between 2012 and 2016 in some Midwestern states and the half-dozen Democratic senators from solidly red states disprove both of those notions. But the data show that the baseline presidential partisanship of the state (something Flake has virtually no control over) isn't so unfavorable for Republicans. Moreover, Hispanics and millennials (some of whom are the same people) often turn out in lower rates for midterms than presidential elections. If that happens again in 2018, it could temporarily turn back the clock on Arizona’s demographic changes.

In other words, Flake can't control Arizona demographics, but those don't look so bad for him. In fact, a generic Republican incumbent would have an advantage heading into an Arizona Senate election -- maybe even one big enough to withstand a moderately pro-Democratic midterm.

But that brings up two other key questions -- whether Flake is “generic” and how pro-Democratic this midterm will be.

Flake’s Odd Political Calculus May Have Already Trapped Him

Jeff Flake isn't a generic Republican.

For the last few years, the first-term senator has been carving out a weird niche for himself. He's picked public fights with Trump since the GOP primary, most recently writing some scathing commentary in a book and op-ed. And in 2013, Flake was part of the bipartisan “Gang of Eight” that futilely attempted immigration reform.

He isn't the only Republican who has been critical of Trump, and he's not the only one to take public positions that oppose GOP orthodoxy. But, unlike some other party members, Flake has a staunchly conservative voting record. Unlike senior Arizona Sen. John McCain, for example, Flake voted for the failed Republican effort to roll back the Affordable Care Act. And unlike Maine Sen. (and frequent Trump critic) Susan Collins, Flake has -- according to the political science measure known as DW NOMINATE -- one of the most conservative voting records in the chamber.

This reverse triangulation (which has also been pointed out by Sean Trende and Kyle Kondik) means that Flake gets the worst of both worlds. He loses some staunch Trumpish voters by attacking the president and taking a few unorthodox positions, but votes too conservatively on the whole to bring in many Democratic crossover votes.

This isn't just a theoretical problem for Flake -- it shows up in elections and polling. In 2012, Romney won the state by nine points while Flake won his Senate race by only three. I used an RCP Senate model to check if Democrat Richard Carmona was responsible for the difference, and found that he performed almost exactly as we would expect a Democratic non-incumbent to, given Obama's approval rating at the time. Flake, on the other hand, won 49.2 percent of the vote while Romney won 53.5 percent, and earned 129,127 fewer total votes than Romney while Carmona actually earned 11,310 more than Obama.

In other words, Flake underperformed one of the most generic Republican presidential candidates in recent memory by a modest but real margin. Those problems continue today. His approval rating was only 37 percent in July and a recent HighGround poll shows him losing both the primary and the general election to his opponents.

Maybe the most difficult part of Flake’s situation is that he only has so much ability to change these perceptions. If he tries to run toward the right rhetorically and mollify the base, his opponents can fire back by reading quotes from his book. If he tries to run to the left, his Democratic opponents can point out his record on tough votes like Obamacare repeal.

That's not to say Flake has no political moves, or even that he made a strategic error. Flake may have consciously chosen to sacrifice an easier re-election bid so that he could speak and vote in accordance with his best judgment. But his actions have created pressures from multiple angles -- pressures that he may have some trouble alleviating.

The Trump Effect -- a Problem That He Can’t Do Much About

The last key part of this puzzle is, of course, President Trump.

Trump has shown that Flake’s feelings for him are, to put it gently, reciprocated. The president has shown some warmth towards Kelli Ward, Flake’s only declared primary challenger. If Flake were to lose the nomination to her, the race would swing significantly towards Democrats. The GOP would lose any advantage Flake had through incumbency while adding Ward’s liabilities. Trump’s enthusiasm for a primary challenger could backfire by causing multiple Trump-friendly Flake opponents to join the race and split the vote between them. But the point is that Trump may make this primary difficult for Flake.

Maybe more importantly, Trump might unintentionally make the general election difficult for Flake. The president’s job approval rating (something Flake has no control over) is low, and, as our model has shown, a low presidential approval rating is bad news for an Arizona Republican. You can test out the simulations using the link above, but some back-of-the-envelope math makes the point just as well. Suppose Trump’s approval rating is 40 percent on Election Day 2018, Arizona is six points more Republican than the country and Flake gets a three-point boost from incumbency. That puts him at 49 percent without accounting for any third-party-voting Republicans, further decay in Trump’s approval or votes that a strong Democratic challenger might steal.

Obviously many of these factors could move in the opposite direction. Trump’s approval could improve. Flake could draw a weak challenger. Maybe he’ll find a way to win crossover voters or consolidate conservatives. But the larger point is that Trump (over whom Flake exerts little, if any, influence) will likely be responsible for the national political environment. And if Trump’s approval doesn't change, Flake may have a real race on his hands.