Reduced scope of variable after cppcheck run