Updated method for Sonar violation