North Carolina politics have been messy, to say the least. Capping off a year of power struggles, the narrow defeat of Gov. Pat McCrory (R) led to a legislative backlash that drew widespread criticism for undermining the democratic process itself.

In fact, a new report from the Electoral Integrity Project says that North Carolina should no longer be classified as a “fully functioning democracy,” a lead EIP researcher wrote in the Raleigh News & Observer.

The report points to three main flaws in North Carolina’s political system: extreme gerrymandering, voter suppression of black and brown residents, and the usurpation of incoming governor Roy Cooper’s power through hasty legislation.

“If it were a nation state, North Carolina would rank right in the middle of the global league table ― a deeply flawed, partly free democracy that is only slightly ahead of the failed democracies that constitute much of the developing world,” UNC-Chapel Hill political scientist Andrew Reynolds wrote in the Dec. 22 op-ed.

The EIP is a nonpartisan project that grades democracies worldwide on a 100-point scale. The gradings are based on multiple factors including voter access to polling sites, the influence of state-controlled media and the potential that an election has been rigged.

For this year’s election, North Carolina received a score of 58 out of 100, Reynolds wrote. That’s in the same neighborhood as the governments of Cuba, Sierra Leone and Indonesia.

But the idea that North Carolina is on par with such countries has come under criticism, notably from Andrew Gelman, a political scientist at Columbia University who takes issue with the report’s methodology.

The EIP sends a survey to participating elections experts asking them to evaluate elections around the world based on 49 indicators. The experts gauge if those contests met international standards before the campaign begins, during the campaign, on Election Day and in the days following. This year, about 40 domestic and international experts were consulted for each election, and the overall response rate was 29 percent.

This methodology is how North Korea’s ruling regime was judged to have “moderate” electoral integrity in 2014, as Gelman pointed out in a Jan. 2 post on his website:

“Who did they get to fill out this survey? Walter Duranty?

“OK, let’s look more carefully. In this table, the response rate for North Korea is given as 6%. And the report said they consulted about 40 ‘domestic and international experts’ for each election. Hmmm ... 6% of 40 is 2.4, so maybe they got 3 respondents for North Korea, 2 of whom were Stalinists.

“That 2014 report mentioned above gave North Korea a rating of 65.3 out of 100 and Cuba a rating of 65.6. Both these numbers are higher than at least 27 of the 50 U.S. states in 2016, according to the savants at the Electoral Integrity Project.

“Political science, indeed.”

(In case you got stuck on Walter Duranty: He was a now-notorious New York Times reporter based in Moscow whose coverage of Joseph Stalin’s rule often downplayed or excused the brutal facts of Soviet communism, most notably in denying the widespread famine of 1932-33.)

Gelman further noted that North Carolina isn’t even the lowest ranked state.

It’s not that he’s a particular fan of what’s been going on in North Carolina.

“If [the scholars associated with the Electoral Integrity Project] don’t like what the North Carolina legislature has been doing, fine. It could even be unconstitutional, I have no sense of such things. ... Vote suppression is not the same thing as an [sic] one-party state and any number-juggling that suggests that is just silly, but, sure, put together enough restrictions and gerrymandering and ex post facto laws and so on, and that can add up,” Gelman wrote.

“Electoral integrity is an important issue, and it’s worth studying. In a sensible way,” he concluded ― before calling out several media outlets, including The Huffington Post, for give the report “credulous” coverage.

Chris Keane/Reuters Former North Carolina Gov. Pat McCrory (R) has come under scrutiny for a series of controversial political decisions during his tenure.

Patsy Keever, chairwoman of the North Carolina Democratic Party, agreed with the report, saying that her state’s current efforts at governing do not adhere to democratic principles.

“Senator [Phil] Berger and Speaker [Tim] Moore are power hungry leaders whose number one goal is to protect their power no matter the cost,” Keever said in a statement to HuffPost, referring to the state’s Senate leader and House speaker.

“Since 2010, the NC GOP has systematically engaged in a dangerous partisan political agenda, making it harder for people to vote, changing the nature of the State Board of Elections and stripping an incoming Democratic governor of power,” she said. “That’s not what democracy looks like ― and North Carolinians deserve better.”

The flaws in North Carolina’s democratic system predate this last election, according to the EIP report. The Republican-controlled legislature racially gerrymandered its own district lines to such a degree in 2011 that a federal court struck down the electoral map as unconstitutional on Nov. 29 and ordered the state to hold special elections in 2017. The EIP concluded that the state of North Carolina had the least democratic redistricting in the world.

“There is nowhere in the world outside of America that allows politicians to change the district lines to this degree; it’s a recipe for disaster,” Reynolds told HuffPost. “You’ve got voters locked into a system where they’re unable to change the power dynamics of the state, regardless how they vote.”

The North Carolina GOP has also been accused of suppressing black voters, which drew a lawsuit from the state NAACP in October. Thousands of voter registrations, most belonging to black residents, were canceled with less than a week left before the election.

Access to voting is a key principle of democracy, one that North Carolina directly attempted to undermine, Reynolds said.

But the most blatant move by the North Carolina Republicans to maintain their power came in two laws hastily passed since the gubernatorial election. On Dec. 19, McCrory signed HB 17, which undercuts the power of the incoming governor by requiring Cooper’s Cabinet picks to be approved by the Republican-dominated Senate and cutting the number of state officials he can appoint. The previous week, McCrory had signed SB 4, which increases the number of people on the North Carolina Board of Elections from five to eight, half to be chosen by the governor and half by the legislature ― thereby ensuring an even party split and an effective deadlock on voting matters.

The EIP took all these factors into account when assessing North Carolina and concluded that maintaining party power had taken precedence over adhering to true democratic principles.

How can North Carolina ― and the United States as a whole ― turn this around? Reynolds had two suggestions to start: An independent entity should be assigned to draw more fair and representative districts, and voting rights advocates must continue the legal battle against voter suppression in the federal courts.

“If we know the elections are deeply flawed, and we see all these other puzzle pieces ... it adds up to a deep atrophy of democracy that is no longer worth its name,” Reynolds said. “We claim to be the greatest democracy in the world, but if you look at the symptoms, it’s pretty sick.”

This post has been updated to include criticism of the EIP report.