NXP-12401 NXP-12508: fix Sonar violations