[Code] Improved cppcheck script and fixed all warnings.