Despite numerous scandals involving the conduct of CEO Elon Musk, the major problem facing Tesla, Inc. (TSLA) has been financial viability. The electric car manufacturer has never been profitable, but financial firm Macquarie Research thinks that could change in the near future, according to CNBC.

Analyst Maynard Um was optimistic about Tesla’s ability to turn a profit by the end of 2018, thanks to government credits for clean energy and increased Model 3 production. Tesla recently opened up Model 3 deliveries to the general public. The company reported strong production and delivery growth in the third quarter.

Musk blamed delayed deliveries on high volume in September.

Um also raised Tesla's target price to $430, which would mean an increase of around 70 percent. Tesla got part of the way there Tuesday, though, as its share price gained around 5 percent by the early afternoon — a strong day for one of the market's most shorted stocks.

Still, the gain was only modest relative to the losses Tesla has recently incurred. Tesla shares rose by as much as 17 percent on Oct. 1 due to Musk’s settlement with the SEC after his infamous take-private scandal. By the end of the week, those gains were all but erased by yet another Musk tweet, in which he questioned the integrity of the SEC.

Macquarie’s projection of profitability is in line with what Musk has said for several months. In June, he predicted Tesla could turn a profit by the end of the third quarter. He told Tesla employees after the SEC settlement to focus and not get distracted because profitability was achievable in the near term.

"We view Tesla as a disruptive technology growth company with differentiated products and strong brand presence in the secularly growing and equally disruptive markets of electric vehicles, energy storage, and energy generation," Um said.