CAL-853: Fix major violations in Sonar