Index: cppcheck.err =================================================================== diff -u -r43668888e2a573f688493685ce3535c3b2117558 -r47baa703592f0e21098cb21c0ed267de4e958b2f --- cppcheck.err (.../cppcheck.err) (revision 43668888e2a573f688493685ce3535c3b2117558) +++ cppcheck.err (.../cppcheck.err) (revision 47baa703592f0e21098cb21c0ed267de4e958b2f) @@ -1,4 +1,4 @@ -01/23/2025 15:31 +05/28/2026 16:40 Dara Navaei sources/canbus/MessageAcknowModel.h:58:9: performance: When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning '_sequence' a value by passing the value to the constructor in the initialization list. [useInitializationList] _sequence = vSequence ; @@ -81,12 +81,6 @@ sources/StateController.cpp:10:18: warning: Member variable 'StateController::_isSendListReady' is not initialized in the constructor. [uninitMemberVarPrivate] StateController::StateController(QObject *parent) : QObject(parent) {} ^ -sources/StateController.cpp:10:18: warning: Member variable 'StateController::_treatmentVars' is not initialized in the constructor. [uninitMemberVarPrivate] -StateController::StateController(QObject *parent) : QObject(parent) {} - ^ -sources/StateController.cpp:10:18: warning: Member variable 'StateController::_treatmentParams' is not initialized in the constructor. [uninitMemberVarPrivate] -StateController::StateController(QObject *parent) : QObject(parent) {} - ^ sources/StateController.cpp:10:18: warning: Member variable 'StateController::_hasUserConfirmedToProceed' is not initialized in the constructor. [uninitMemberVarPrivate] StateController::StateController(QObject *parent) : QObject(parent) {} ^ @@ -108,39 +102,6 @@ sources/canbus/MessageDispatcher.cpp:266:9: note: Condition 'mNeedsAcknow' is always false if (mNeedsAcknow) { ^ -sources/canbus/MessageDispatcher.cpp:308:9: style: Condition 'mNeedsAcknow' is always false [knownConditionTrueFalse] - if (mNeedsAcknow) { - ^ -sources/canbus/MessageDispatcher.cpp:307:25: note: Assignment 'mNeedsAcknow=false', assigned value is 0 - bool mNeedsAcknow = false; //needsAcknow(vCanId); - ^ -sources/canbus/MessageDispatcher.cpp:308:9: note: Condition 'mNeedsAcknow' is always false - if (mNeedsAcknow) { - ^ -sources/canbus/MessageDispatcher.cpp:326:9: style: Condition 'mNeedsAcknow' is always false [knownConditionTrueFalse] - if (mNeedsAcknow) { - ^ -sources/canbus/MessageDispatcher.cpp:307:25: note: Assignment 'mNeedsAcknow=false', assigned value is 0 - bool mNeedsAcknow = false; //needsAcknow(vCanId); - ^ -sources/canbus/MessageDispatcher.cpp:326:9: note: Condition 'mNeedsAcknow' is always false - if (mNeedsAcknow) { - ^ -sources/canbus/MessageDispatcher.cpp:395:19: style: The scope of the variable 'mActionId' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced: -void f(int x) -{ - int i = 0; - if (x) { - // it's safe to move 'int i = 0;' here - for (int n = 0; n < 10; ++n) { - // it is possible but not safe to move 'int i = 0;' here - do_something(&i); - } - } -} -When you see this message it is always safe to reduce the variable scope 1 level. [variableScope] - int mActionId = 0; - ^ sources/model/settings/MSettings.cpp:45:15: style: Consider using std::accumulate algorithm instead of a raw loop. [useStlAlgorithm] mKeys += keyValue.key(); ^