Skip to content

fix: float precision in config retrieval (#2889) #214

fix: float precision in config retrieval (#2889)

fix: float precision in config retrieval (#2889) #214

GitHub Actions / reviewdog succeeded Sep 13, 2024 in 0s

reviewdog report

reported by reviewdog 🐶

Findings (0)
Filtered Findings (169)

src/canary_server.cpp|| Too many #ifdef configurations - cppcheck only checks 12 of 26 configurations. Use --force to check all configurations.
src/canary_server.cpp|264| Skipping configuration 'NDEBUG;_MSC_VER;_WIN32' since the value of '_MSC_VER' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/canary_server.cpp|264| Skipping configuration '_MSC_VER' since the value of '_MSC_VER' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/canary_server.cpp|264| Skipping configuration '_MSC_VER;_WIN32' since the value of '_MSC_VER' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/canary_server.cpp|266| Skipping configuration 'GNUC' since the value of 'GNUC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/security/rsa.hpp|16| Class 'RSA' has a constructor with 1 argument that is not explicit.
src/game/game.hpp|385| Function parameter 'itemIds' should be passed by const reference.
src/game/scheduling/dispatcher.hpp|101| Function parameter 'context' should be passed by const reference.
src/game/scheduling/dispatcher.hpp|106| Function parameter 'context' should be passed by const reference.
src/game/zones/zone.hpp|205| Unused variable: _
src/creatures/combat/combat.cpp|40| Variable 'magicLevelSkill' is assigned a value that is never used.
src/creatures/combat/combat.cpp|1498| Variable 'pos' is not assigned a value.
src/creatures/combat/condition.cpp|1790| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/creature.cpp|1463| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/creature.cpp|1473| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/creature.cpp|1600| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/interactions/chat.cpp|482| The statement 'if (type!=TALKTYPE_CHANNEL_Y) type=TALKTYPE_CHANNEL_Y' is logically equivalent to 'type=TALKTYPE_CHANNEL_Y'.
src/creatures/monsters/monster.cpp|1011| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/monsters/monster.cpp|1142| Consider using std::count_if algorithm instead of a raw loop.
src/creatures/monsters/monster.cpp|1211| Variable 'x' is not assigned a value.
src/creatures/monsters/monsters.cpp|258| Condition '!combatSpell' is always false
src/creatures/monsters/monsters.cpp|266| Condition 'combatSpell' is always true
src/creatures/monsters/spawns/spawn_monster.cpp|302| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/monsters/spawns/spawn_monster.cpp|151| Unused variable: _
src/creatures/monsters/spawns/spawn_monster.cpp|332| Variable 'id' is not assigned a value.
src/creatures/monsters/spawns/spawn_monster.cpp|366| Variable 'id' is not assigned a value.
src/creatures/npcs/npc.cpp|264| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/npcs/npc.cpp|377| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/grouping/guild.cpp|37| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/grouping/guild.cpp|46| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/grouping/guild.cpp|55| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/grouping/party.cpp|508| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/grouping/party.cpp|526| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/grouping/party.cpp|755| Variable '(*it).second' is assigned a value that is never used.
src/creatures/players/grouping/party.cpp|782| Variable '(*it).second' is assigned a value that is never used.
src/creatures/players/imbuements/imbuements.cpp|342| Unused variable: key
src/creatures/players/player.cpp|387| Redundant condition: shield. '!A || (A && B)' is equivalent to '!A || B'
src/creatures/players/player.cpp|416| Condition 'weapon' is always false
src/creatures/players/player.cpp|421| Condition 'shield' is always false
src/creatures/players/player.cpp|422| Condition 'weapon!=nullptr' is always false
src/creatures/players/player.cpp|2872| The scope of the variable 'maxBlessing' can be reduced.
src/creatures/players/player.cpp|851| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|1971| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/players/player.cpp|2251| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/player.cpp|4760| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|4984| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|5005| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|5059| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/players/player.cpp|5068| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/players/player.cpp|6516| Consider using std::copy_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|7929| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/player.cpp|7988| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/player.cpp|635| Unused variable: key
src/creatures/players/player.cpp|1197| Variable 'npc' is assigned a value that is never used.
src/creatures/players/player.cpp|3004| Unused variable: key
src/creatures/players/player.cpp|3058| Unused variable: key
src/creatures/players/player.cpp|3064| Unused variable: key
src/creatures/players/player.cpp|4007| Unused variable: index
src/creatures/players/player.cpp|7043| Variable 'itemId' is not assigned a value.
src/creatures/players/player.cpp|7214| Variable 'mapTier' is not assigned a value.
src/creatures/players/player.cpp|7942| Variable 'stage' is assigned a value that is never used.
src/creatures/players/vocations/vocation.cpp|219| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/wheel/player_wheel.cpp|2082| The scope of the variable 'magicSkill' can be reduced.
src/creatures/players/wheel/player_wheel.cpp|2083| The scope of the variable 'distanceSkill' can be reduced.
src/creatures/players/wheel/player_wheel.cpp|2111| The scope of the variable 'newCritical' can be reduced.
src/creatures/players/wheel/player_wheel.cpp|132| struct member 'PromotionScroll::itemId' is never used.
src/creatures/players/wheel/player_wheel.cpp|134| struct member 'PromotionScroll::extraPoints' is never used.
src/creatures/players/wheel/player_wheel.cpp|2885| Variable 'name_it' is not assigned a value.
src/game/scheduling/events_scheduler.cpp|95| Local variable 'eventName' shadows outer variable
src/game/scheduling/save_manager.cpp|19| Unused variable: _
src/game/scheduling/save_manager.cpp|25| Unused variable: _
src/game/scheduling/task.cpp|19| Function parameter 'context' should be passed by const reference.
src/game/scheduling/task.cpp|29| Function parameter 'context' should be passed by const reference.
src/game/zones/zone.cpp|98| Consider using std::copy algorithm instead of a raw loop.
src/game/zones/zone.cpp|146| Unused variable: _
src/game/zones/zone.cpp|154| Unused variable: _
src/game/zones/zone.cpp|162| Unused variable: _
src/game/zones/zone.cpp|177| Unused variable: _
src/io/functions/iologindata_load_player.cpp|874| Unused variable: id
src/io/functions/iologindata_save_player.cpp|38| Condition '!container' is always false
src/io/functions/iologindata_save_player.cpp|333| Variable 'itemId' is not assigned a value.
src/io/functions/iologindata_save_player.cpp|785| Variable 'key' is not assigned a value.
src/io/io_bosstiary.cpp|290| Consider using std::count_if algorithm instead of a raw loop.
src/io/io_bosstiary.cpp|77| Variable 'randomBossId' is not assigned a value.
src/io/io_bosstiary.cpp|157| Variable 'bossRaceId' is not assigned a value.
src/io/iobestiary.cpp|101| Consider using std::find_if algorithm instead of a raw loop.
src/io/iomapserialize.cpp|89| Unused variable: key
src/io/iomapserialize.cpp|339| Unused variable: key
src/io/iomapserialize.cpp|355| Unused variable: key
src/items/functions/item/attribute.cpp|50| Consider using std::find_if algorithm instead of a raw loop.
src/items/functions/item/item_parse.cpp|727| Condition 'conditionDamage' is always false
src/items/functions/item/item_parse.cpp|562| Consider using std::transform algorithm instead of a raw loop.
src/items/item.cpp|2977| Condition 'subType!=1' is always true
src/items/item.cpp|1139| The scope of the variable 'isTradeable' can be reduced.
src/items/tile.cpp|1828| Condition 'items' is always true
src/kv/value_wrapper.cpp|51| Unused variable: _
src/lib/metrics/metrics.hpp|81| Class 'method_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|82| Class 'lua_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|83| Class 'query_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|84| Class 'task_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|85| Class 'lock_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|81| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|82| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|83| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|84| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|85| Function parameter 'name' should be passed by const reference.
src/lua/creature/creatureevent.cpp|17| Unused variable: name
src/lua/creature/movement.cpp|160| Consider using std::any_of algorithm instead of a raw loop.
src/lua/functions/core/game/game_functions.cpp|45| Condition '!monsterType' is always false
src/lua/functions/core/game/game_functions.cpp|70| Local variable 'alternateName' shadows outer variable
src/lua/functions/creatures/combat/spell_functions.cpp|617| Either the condition 'vocList.size()>0' is redundant or vocList size can be 1. Expression 'vocList[1]' cause access out of bounds.
src/lua/functions/creatures/creature_functions.cpp|508| Expression is always true because 'else if' condition is opposite to previous condition at line 506.
src/lua/functions/creatures/creature_functions.cpp|811| Condition 'oldPosition.x<position.x' is always true
src/lua/functions/creatures/monster/monster_type_functions.cpp|1040| Unused variable: _
src/lua/functions/creatures/npc/npc_functions.cpp|559| The scope of the variable 'shoppingBagSlots' can be reduced.
src/lua/functions/creatures/npc/npc_functions.cpp|578| Consider using std::find_if algorithm instead of a raw loop.
src/lua/functions/creatures/npc/npc_functions.cpp|584| Unused variable: _
src/lua/functions/creatures/player/player_functions.cpp|492| Condition '!slot' is always false
src/lua/functions/creatures/player/player_functions.cpp|342| Consider using std::any_of algorithm instead of a raw loop.
src/lua/functions/creatures/player/player_functions.cpp|3113| Unused variable: key
src/lua/functions/items/item_functions.cpp|732| Condition 'moveItem' is always false
src/lua/scripts/script_environment.cpp|77| Consider using std::find_if algorithm instead of a raw loop.
src/main.cpp|| Too many #ifdef configurations - cppcheck only checks 12 of 17 configurations. Use --force to check all configurations.
src/map/house/house.cpp|718| Consider using std::find_if algorithm instead of a raw loop.
src/map/map.cpp|1030| Consider using std::copy_if algorithm instead of a raw loop.
src/map/mapcache.cpp|122| Consider using std::copy algorithm instead of a raw loop.
src/security/rsa.cpp|164| The scope of the variable 'buffer' can be reduced.
src/server/network/connection/connection.cpp|65| Redundant assignment of 'protocol' to itself.
src/server/network/connection/connection.cpp|101| Redundant assignment of 'protocol' to itself.
src/server/network/protocol/protocolgame.cpp|349| Condition 'containerType==0' is always true
src/server/network/protocol/protocolgame.cpp|3172| Condition 'counter>0' is always true
src/server/network/protocol/protocolgame.cpp|70| Consider using std::distance algorithm instead of a raw loop.
src/server/network/protocol/protocolgame.cpp|2958| Unused variable: ss
src/server/network/protocol/protocolgame.cpp|4363| Variable 'flag' is assigned a value that is never used.
src/server/network/protocol/protocolgame.cpp|4371| Variable 'flag' is assigned a value that is never used.
src/server/network/protocol/protocolgame.cpp|5302| Variable 'tier' is not assigned a value.
src/server/network/protocol/protocolgame.cpp|5323| Variable 'tier' is not assigned a value.
src/server/network/protocol/protocolgame.cpp|7682| Variable 'masterPlayer' is assigned a value that is never used.
src/server/network/protocol/protocolgame.cpp|8572| Variable 'itemTier' is not assigned a value.
src/server/network/protocol/protocolstatus.cpp|109| Unused variable: key
src/server/server.cpp|119| Redundant assignment of 'serverPort' to itself.
src/utils/tools.cpp|1723| Condition 'number>=7400' is always true
src/utils/tools.cpp|483| Function parameter 'string' should be passed by const reference.
src/utils/tools.cpp|1564| Function parameter 'stringToIgnore' should be passed by const reference.
src/utils/tools.cpp|193| Consider using std::accumulate algorithm instead of a raw loop.
src/utils/tools.cpp|387| Consider using std::transform algorithm instead of a raw loop.
src/utils/tools.cpp|1026| Consider using std::find_if algorithm instead of a raw loop.
src/utils/tools.cpp|415| Variable 'a' is not assigned a value.
src/creatures/players/cyclopedia/player_title.cpp|267| The function 'checkMap' is never used.
src/utils/tools.cpp|453| The function 'formatTime' is never used.
src/utils/tools.cpp|198| The function 'generateToken' is never used.
src/utils/tools.cpp|1625| The function 'getObjectCategoryName' is never used.
src/utils/tools.cpp|1782| The function 'getPlayerObjectPronoun' is never used.
src/utils/tools.cpp|1799| The function 'getPlayerPossessivePronoun' is never used.
src/utils/tools.cpp|1816| The function 'getPlayerReflexivePronoun' is never used.
src/utils/tools.cpp|1765| The function 'getPlayerSubjectPronoun' is never used.
src/utils/tools.cpp|919| The function 'getSkullType' is never used.
src/utils/tools.cpp|939| The function 'getSpawnType' is never used.
src/utils/tools.cpp|1833| The function 'getVerbForPronoun' is never used.
src/utils/tools.cpp|911| The function 'getWeaponAction' is never used.
src/utils/pugicast.cpp|13| The function 'logError' is never used.
src/game/game.cpp|140| The function 'playerCanUseItemWithOnHouseTile' is never used.
src/utils/tools.cpp|283| The function 'toCamelCase' is never used.
src/utils/tools.cpp|339| The function 'toKebabCase' is never used.
src/utils/tools.cpp|323| The function 'toSnakeCase' is never used.
src/creatures/players/cyclopedia/player_badge.cpp|148| The function 'tournamentParticipation' is never used.
src/creatures/players/cyclopedia/player_badge.cpp|153| The function 'tournamentPoints' is never used.
src/utils/tools.cpp|1592| The function 'validateName' is never used.
nofile|| Cppcheck cannot find all the include files (use --check-config for details)