Tesla, Inc. is a magnet for lawsuits, and the U.S. Securities and Exchange Commission (SEC) is the least of its worries.

There have been at least 38 securities actions filed against Tesla or Elon Musk (or both) since 2010, the year it went public, which is a large number compared to other U.S. automakers over the same period, according to legal research website Plainsite.

These pieces of litigation, including the costs of defense and settlements, is adding to Tesla's and Musk's financial troubles, and might have played a role in Tesla's decision to slash headcount, close stores and delaying loan repayments.

The money Tesla is spending on legal fees might have gone to improving its service, adding manufacturing lines to build the Model Y (its upcoming compact SUV), or building its Shanghai Gigafactory.

SEC has a pending court motion to hold Musk in contempt of court for continuing to tweet information relating to its operations without its approval. It argues that Musk violated an agreement they finalized with him and Tesla in October 2018.

This settlement requires Musk to submit his tweets for review by the company's in-house counsel if they contain material business information and could potentially affect the company's stock price. Tesla's legal problems aren't confined to its run-ins with the SEC.

The National Highway Traffic Safety Administration (NHTSA) and the National Transportation Safety Board (NTSB) are again investigating crashes involving Tesla electric vehicles and the use of the vehicle's "Autopilot" features.

Both agencies began new investigations in March 2019 after another Tesla-involved incident proved resulted in the death of a Model 3 driver, who collided with a semi-trailer in Florida.

Karl Hansen and Sean Gouthro, two former employees with Tesla's security unit, have filed whistleblower complaints with the SEC. They claim Tesla spied on workers, and covered up theft and narcotics trafficking at its battery plant in Nevada.

Another former employee, Marcus Vaughn, filed a class-action lawsuit against Tesla, alleging the company ignored black employees' reports of rampant racism. Tesla is trying to compel arbitration, and Vaaughn's lawyers are fighting Tesla's motions.

Then, there are lawsuits brought by Tesla. A former Tesla employee named Salil Parulekar was indicted in November 2018 for allegedly embezzling $9.3 million from Tesla by diverting payments from one supplier to another. The case might reveal more troubles with Tesla's supply chain.