Fix Sonar major violation: NPath Complexity