So Tesla's code quality is probably messier than that of "pure" high-tech companies like Google or Apple, but it's still much, much better than typical automotive software. Security design at Tesla seems to be robust. Note that code quality problems very likely do not affect Andrej Karpathy's AI group or the AI chip, which are probably Tesla's most important software/hardware projects. Tesla's road-map so far has been to put out one fire after another and probably cutting code quality corners, and I'd expect that with time this will all improve: SpaceX has high software standards and I suspect Elon is going to match Tesla's software practices to that of SpaceX's. Takes time and the ease of mind of profitability.