fixing SAST type problems and errors but still has warnings