Bad NBA contracts were everywhere in the 2000s. Some were at relatively low numbers (hello, Brian Cardinal and Jerome James). And others were at eye-popping numbers: Stephon Marbury, Larry Hughes, Erick Dampier, Steve Francis, Eddy Curry, and Raef LaFrentz were all good players who were paid like superstars.

You had guys who were, or could have been, stars like Allan Houston, Ben Wallace, Jermaine O’Neal, Gilbert Arenas, and Chris Webber larding up the books after injuries, age, and/or legal issues struck.

What the bad contracts of the 2000s all had in common was length. Contracts were tortuously long back then, stretching for up to seven years prior to 2005 and six years after. You weren’t just locking up a fifth of your salary cap sheet on a mediocre player if you made a mistake. The damage was lasting.

A few factors reversed the trend and (until recently) made bad contracts more rare.

The biggest is shorter contract length. Teams can now only sign their own free agents to a maximum of five-year contracts, and outside free agents to four-year contracts. This has cut down on the ability of teams to saddle themselves with long-term busts. Four years is still a long time, but it’s not seven years. The longer a commitment, the more potential things that can go wrong.

Another factor has been the growing salary cap number. The enormous cap spike in 2016 basically ensured any contract signed before that year couldn’t be all that bad. Those 2015 and prior contracts (mid-levels, maxes, everything in between) that were still on the books were calculated off of a cap which was 25 percent smaller. Unless they were completely dead cap space due to waived or injured players, they were no problem.

But that salary cap spike created an opening for a new generation of bad contracts. And for one glorious summer, we got them in spades.

The cap spike meant lots of teams would have free agent money to burn. It meant max contracts would be richer. Those higher max deals created a bigger spread in potential salary levels for the NBA’s middle class to flood into. And a shallow free agent class meant that a lot of mid-tier players would get lots and lots of money.

Timofey Mozgov and Luol Deng signed with the Lakers for a combined $137 million over four years. Chandler Parsons — who had been recovering from injury going into the offseason — signed a max four-year, $94 million contract with the Grizzlies. The Knicks inked Joakim Noah to a four-year, $73 million deal. Ryan Anderson picked up four years and $80 million. Allen Crabbe got a four-year, $75 million contract. Evan Turner got four years and $70 million.

At the lower end of the salary pool, rotation players got what would have previously been eye-popping contracts. Some examples: Andrew Nicholson at $26 million for four years, Solomon Hill at $48 million for four years, and Matthew Dellavedova at $38 million for four years.

A couple of those worked out — Dellavedova is fine at that price point, Crabbe remained movable (which we’ll get to), and Anderson (though a contract albatross) fits the Rockets well. Many did not.

The Lakers moved off of the Mozgov deal by attaching D’Angelo Russell — a fairly recent No. 2 overall pick — to him in a trade with the Nets. Parsons and Noah are almost lost causes due to injury with tens of millions of dollars left in salary commitment. Houston has been trying to find a new home for Anderson to free up salary space to take in a third star like Carmelo Anthony.

The Blazers realize they shouldn’t have matched the Nets’ hefty offer sheet to Crabbe last summer. On Monday, Portland traded Crabbe for Nicholson before waiving and stretching the latter.

(What an incredible accomplishment for Nicholson: one year after signing a contract that could create generational wealth for his family, he’s been traded twice and waived under the stretch provision.)

Over the next year, more 2016 contracts will likely be moved under duress. One expects L.A. — if it is serious about being a player in 2018 free agency — to attach an attractive prospect that doesn’t fit the future to Deng. One imagines Houston finding a way out from under Anderson. Perhaps New Orleans, who is capped out and preparing to give DeMarcus Cousins a big new contract in 2018, can move Hill. Parsons and Noah are likely too onerous to escape without crushing, untenable sweeteners.

With a more modest salary cap increase and fewer teams with gaping space on the cap sheets, we have seen far fewer bad contracts this summer.

As always, we’ll see. Tim Hardaway Jr. seems like a major risk, and there is wide consensus that giving a player with as long an injury history as Blake Griffin five years is a dice roll. We haven’t seen one of the new Designated Player extensions — like those given to James Harden and John Wall — play out fully yet, but perhaps there is injury risk there, too. Odds are there will be one-off bad contracts going forward, but nothing like the spate we saw in 2016.

Let this be another gift the cap spike gives us, in addition to the Ultra-Warriors: a return to the days of the cap-crushing bad contract. We missed you, old buddy. Welcome back.