SOC-4099 | [Sonar] Fix the Blocker and Critical violations reported by sonar.