Sonar Major warning: Consider simply returning the value vs storing it in local variable