I have set alot of values like this in my code using builder function but everywhre on && and ? operators I m getting sonarLint cognitive complexity issue.
here
AppointmentDetailsInfo appointmentDetails =(newAppointmentDetailsDTO !=null &&newAppointmentDetailsDTO.getData()!=null && newAppointmentDetailsDTO.getData().getAppointmentDetails()!=null) ?newAppointmentDetailsDTO.getData().getAppointmentDetails():null;
and here also
isNewPatient(gosDTO != null ? gosDTO .getIsNewPatient() ? 1 : 0 : null);
referredProviderName(gosDTO != null ? gosDTO .getReferredProviderName() : null);
isMobile(gosDTO != null ? gosDTO .getIsMobile() : null);
how it can be correct?