Google's John Mueller and Gary Illyes both said in a Reddit thread that code to text ratios for SEO does not matter. John Mueller said it is not an SEO factor and Gary Illyes said "it doesn't matter."
This is not new, Google has said this numerous times in the past but this is the 2022 version of, is code to text ratio and SEO factor. :-)
The question asked was "How important is "Code to Text" ratio?"
John Mueller of Google responded "The code to text ratio is not, and never has been, a factor in SEO."
Gary Illyes of Google responded "it doesn't matter. just have some decent content."
Several years ago, John Mueller was asked "Is there any term like text to code ratio in SEO?" John responded then "No. We we don't use anything like text to code when it comes to Google search."
So don't worry about it.
Forum discussion at Reddit.