Index: cppcheck.err =================================================================== diff -u -r550c426d0137a5b51852d2dee335c7b9ca4914f2 -r5b46bc8e4724e4ddb648f901d76bb7ec24f8b6c7 --- cppcheck.err (.../cppcheck.err) (revision 550c426d0137a5b51852d2dee335c7b9ca4914f2) +++ cppcheck.err (.../cppcheck.err) (revision 5b46bc8e4724e4ddb648f901d76bb7ec24f8b6c7) @@ -1,122 +1,100 @@ -11/03/2022 14:42 +02/02/2023 19:39 Behrouz NematiPour -[sources/storage/FileHandler.h:95] -> [sources/storage/FileHandler.h:102]: (style) Condition '!createFolder' is always false -[sources/ApplicationPost.cpp:109] -> [sources/ApplicationPost.cpp:111]: (style) Condition '!ok' is always false -[sources/ApplicationPost.cpp:204] -> [sources/ApplicationPost.cpp:206]: (style) Condition '!ok' is always false -[sources/ApplicationPost.cpp:218] -> [sources/ApplicationPost.cpp:220]: (style) Condition '!ok' is always false -[sources/MainTimer.cpp:69]: (style) The scope of the variable 'oH' 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. -[sources/MainTimer.cpp:69]: (style) The scope of the variable 'oM' 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. -[sources/MainTimer.cpp:69]: (style) The scope of the variable 'oS' 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. -[sources/cloudsync/CloudSyncController.cpp:500] -> [sources/cloudsync/CloudSyncController.cpp:508]: (style) Variable 'ok' is reassigned a value before the old one has been used. -[sources/cloudsync/CloudSyncController.cpp:662] -> [sources/cloudsync/CloudSyncController.cpp:663]: (style) Variable 'ok' is reassigned a value before the old one has been used. -[sources/cloudsync/CloudSyncController.cpp:673] -> [sources/cloudsync/CloudSyncController.cpp:675]: (style) Variable 'ok' is reassigned a value before the old one has been used. -[sources/cloudsync/CloudSyncController.cpp:701] -> [sources/cloudsync/CloudSyncController.cpp:702]: (style) Variable 'ok' is reassigned a value before the old one has been used. -[sources/cloudsync/CloudSyncController.cpp:812] -> [sources/cloudsync/CloudSyncController.cpp:813]: (style) Variable 'ok' is reassigned a value before the old one has been used. -[sources/cloudsync/CloudSyncController.cpp:901] -> [sources/cloudsync/CloudSyncController.cpp:902]: (style) Variable 'ok' is reassigned a value before the old one has been used. -[sources/device/DeviceController.cpp:255] -> [sources/device/DeviceController.cpp:262]: (style) Variable 'mCIsReady' is reassigned a value before the old one has been used. -[sources/device/DeviceController.cpp:304] -> [sources/device/DeviceController.cpp:311]: (style) Variable 'mCIsReady' is reassigned a value before the old one has been used. -[sources/device/DeviceController.cpp:311] -> [sources/device/DeviceController.cpp:313]: (style) Variable 'mCIsReady' is reassigned a value before the old one has been used. -[sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h:67] -> [sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h:61]: (warning) The class 'MAdjustUltrafiltrationEditResponse' defines member variable with name 'stringPrefix' also defined in its parent class 'MAdjustUltrafiltrationConfirmResponse'. -[sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h:79] -> [sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h:79]: (warning) The class 'MAdjustUltrafiltrationEditResponse' defines member variable with name '_data' also defined in its parent class 'MAdjustUltrafiltrationConfirmResponse'. -[sources/model/settings/MSettings.h:56]: (style) The KeyValue::operator= does not conform to standard C/C++ behaviour. To conform to standard C/C++ behaviour, return a reference to self (such as: 'KeyValue &KeyValue::operator=(..) { .. return *this; }'. For safety reasons it might be better to not fix this message. If you think that safety is always more important than conformance then please ignore/suppress this message. For more details about this topic, see the book "Effective C++" by Scott Meyers. -[sources/model/settings/MSettings.h:44]: (warning) The class 'KeyValue' has 'operator=' but lack of 'copy constructor'. -[sources/storage/Logger.cpp:259] -> [sources/storage/Logger.cpp:261]: (style) Variable 'ok' is reassigned a value before the old one has been used. -[sources/storage/Logger.cpp:189]: (style) The scope of the variable 'notified' 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. -[sources/view/VEventSpy.cpp]: (information) The configuration 'DEBUG_BCUFF_MIMIC' was not checked because its code equals another one. -[sources/view/VTreatmentCreate.cpp:83]: (style) The function 'doCancel' is never used. -[sources/view/settings/VNetworkModel.cpp:238]: (style) The function 'doCheckIfConnected' is never used. -[sources/view/hd/alarm/VAlarmStatus.cpp:95]: (style) The function 'doClearCondition' is never used. -[sources/view/VTreatmentCreate.cpp:72]: (style) The function 'doConfirm' is never used. -[sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:88]: (style) The function 'doDisinfectCancel' is never used. -[sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:127]: (style) The function 'doDisinfectChemical' is never used. -[sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:99]: (style) The function 'doDisinfectClear' is never used. -[sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:132]: (style) The function 'doDisinfectConfirm' is never used. -[sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:109]: (style) The function 'doDisinfectFlush' is never used. -[sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:118]: (style) The function 'doDisinfectHeat' is never used. -[sources/gui/GuiView.cpp:250]: (style) The function 'doExportListInsert' is never used. -[sources/gui/GuiView.cpp:293]: (style) The function 'doExportListPercent' is never used. -[sources/gui/GuiView.cpp:281]: (style) The function 'doExportListSelect' is never used. -[sources/view/VTreatmentCreate(legacy).cpp:539]: (style) The function 'doGetOperatingParameterValues' is never used. -[sources/view/VTreatmentCreate(legacy).cpp:504]: (style) The function 'doGetPrescriptionParameterValues' is never used. -[sources/view/settings/VDateTime.cpp:44]: (style) The function 'doInit' is never used. -[sources/view/VEventSpy.cpp:149]: (style) The function 'doMouseReset' is never used. -[sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp:66]: (style) The function 'doOptionDuration' is never used. -[sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRecirculate.cpp:51]: (style) The function 'doReconnect' is never used. -[sources/view/hd/alarm/VAlarmActiveList.cpp:106]: (style) The function 'doRequest' is never used. -[sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp:99]: (style) The function 'doReset' is never used. -[sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp:64]: (style) The function 'doResult' is never used. -[sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.cpp:51]: (style) The function 'doResume' is never used. -[sources/view/settings/VNetworkModel.cpp:362]: (style) The function 'doSetDNS' is never used. -[sources/view/settings/VNetworkModel.cpp:344]: (style) The function 'doSetGateway' is never used. -[sources/view/settings/VNetworkModel.cpp:335]: (style) The function 'doSetIPAddress' is never used. -[sources/view/settings/VNetworkModel.cpp:353]: (style) The function 'doSetSubnetMask' is never used. -[sources/view/hd/alarm/VAlarmStatus.cpp:78]: (style) The function 'doSilence' is never used. -[sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp:87]: (style) The function 'doSkip' is never used. -[sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.cpp:58]: (style) The function 'doStop' is never used. -[sources/view/VEventSpy.cpp:192]: (style) The function 'doTouchReset' is never used. -[sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRecirculate.cpp:75]: (style) The function 'doTreatmentEnd' is never used. -[sources/view/hd/alarm/VAlarmStatus.cpp:57]: (style) The function 'doUserActionEnd' is never used. -[sources/view/hd/alarm/VAlarmStatus.cpp:67]: (style) The function 'doUserActionOk' is never used. -[sources/view/hd/alarm/VAlarmStatus.cpp:37]: (style) The function 'doUserActionResume' is never used. -[sources/view/hd/alarm/VAlarmStatus.cpp:47]: (style) The function 'doUserActionRinseback' is never used. -[sources/view/VTreatmentCreate.cpp:40]: (style) The function 'doValidation' is never used. -[sources/utility/types.cpp:28]: (style) The function 'floatCompare' is never used. -[sources/utility/types.cpp:44]: (style) The function 'getBits' is never used. -[sources/bluetooth/BluetoothInterface.cpp:1159]: (style) The function 'mimic' is never used. -[sources/storage/FileHandler.cpp:162]: (style) The function 'moveFolder' is never used. -[sources/storage/FileHandler.cpp:203]: (style) The function 'removeFiles' is never used. -[sources/storage/FileHandler.cpp:183]: (style) The function 'removeFolder' is never used. -[sources/bluetooth/BluetoothInterface.cpp:1239]: (style) The function 'requestBattery' is never used. -[sources/bluetooth/BluetoothInterface.cpp:1226]: (style) The function 'requestInformation' is never used. -[sources/bluetooth/BluetoothInterface.cpp:1207]: (style) The function 'requestMeasurements' is never used. -[sources/view/settings/VBluetooth.cpp:79]: (style) The function 'roleNames' is never used. -[sources/MainTimer.cpp:116]: (style) The function 'timerEvent' is never used. -(information) Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project's include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config. +sources/storage/Logger.h:91:5: error: There is an unknown macro here somewhere. Configuration is required. If Q_ENUM is a macro then please configure it. [unknownMacro] + Q_ENUM(LogType) + ^ +sources/model/settings/MSettings.cpp:45:15: style: Consider using std::accumulate algorithm instead of a raw loop. [useStlAlgorithm] + mKeys += keyValue.key(); + ^ +sources/model/settings/MSettings.cpp:74:17: style: Consider using std::accumulate algorithm instead of a raw loop. [useStlAlgorithm] + mValues += keyValue.val(); + ^ +sources/model/settings/MSettings.cpp:91:0: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm] + if ( vKey == keyValue.key() ) return keyValue.val(); +^ +sources/storage/FileHandler.h:102:14: style: Condition '!createFolder' is always false [knownConditionTrueFalse] + if ( ! createFolder ) { if ( ! dstDir.exists() ) { err = eDstFolderNotExist ; goto lErr; }} + ^ +sources/storage/FileHandler.h:95:35: note: Assignment 'createFolder=true', assigned value is 1 + bool createFolder = true; + ^ +sources/storage/FileHandler.h:102:14: note: Condition '!createFolder' is always false + if ( ! createFolder ) { if ( ! dstDir.exists() ) { err = eDstFolderNotExist ; goto lErr; }} + ^ +sources/storage/FileHandler.h:92:17: style: Local variable 'totalSize' shadows outer function [shadowFunction] + qint64 totalSize = 0; + ^ +sources/storage/FileHandler.h:75:21: note: Shadowed declaration + static quint64 totalSize(const QFileInfoList &vFileInfoList); + ^ +sources/storage/FileHandler.h:92:17: note: Shadow variable + qint64 totalSize = 0; + ^ +sources/storage/FileHandler.h:87:33: style: Variable 'err' is assigned a value that is never used. [unreadVariable] + FileCopyError_Enums err = eOK; + ^ +sources/view/VAdjustmentResponseBase.h:61:5: error: There is an unknown macro here somewhere. Configuration is required. If Q_PROPERTY is a macro then please configure it. [unknownMacro] + Q_PROPERTY(QString adjustment_ReasonText READ text NOTIFY adjustment_ReasonTriggered) + ^ +sources/view/dg/data/VDGOperationModeData.h:44:5: error: There is an unknown macro here somewhere. Configuration is required. If Q_PROPERTY is a macro then please configure it. [unknownMacro] + Q_PROPERTY(QString text READ text NOTIFY opModeChanged) + ^ +sources/view/dg/data/VDGValvesStatesData.h:57:5: error: There is an unknown macro here somewhere. Configuration is required. If Q_PROPERTY is a macro then please configure it. [unknownMacro] + Q_PROPERTY(QString text READ text NOTIFY refreshTriggered) + ^ +sources/view/hd/data/VHDOperationModeData.h:79:5: error: There is an unknown macro here somewhere. Configuration is required. If Q_PROPERTY is a macro then please configure it. [unknownMacro] + Q_PROPERTY(QString text READ text NOTIFY opModeChanged) + ^ +sources/view/settings/VBluetooth.h:63:5: error: There is an unknown macro here somewhere. Configuration is required. If Q_ENUM is a macro then please configure it. [unknownMacro] + Q_ENUM(DataRole) + ^ +sources/storage/StorageGlobals.cpp:53:0: style: The function 'Log_Min_Available_Total_Space_IsLow' is never used. [unusedFunction] + +^ +sources/model/settings/MSettings.cpp:126:0: style: The function 'add' is never used. [unusedFunction] + +^ +sources/model/settings/MSettings.cpp:113:0: style: The function 'categorys' is never used. [unusedFunction] + +^ +sources/device/DeviceError.cpp:56:0: style: The function 'checkScript' is never used. [unusedFunction] + +^ +sources/storage/FileHandler.cpp:142:0: style: The function 'copyFolder' is never used. [unusedFunction] + +^ +sources/utility/crc.cpp:50:0: style: The function 'crc8' is never used. [unusedFunction] + +^ +sources/model/settings/MSettings.cpp:152:0: style: The function 'datetimeFormat' is never used. [unusedFunction] + +^ +sources/model/settings/MSettings.cpp:102:0: style: The function 'groups' is never used. [unusedFunction] + +^ +sources/storage/FileHandler.cpp:261:0: style: The function 'isMounted' is never used. [unusedFunction] + +^ +sources/storage/FileHandler.cpp:241:0: style: The function 'makeFolder' is never used. [unusedFunction] + +^ +sources/storage/FileHandler.cpp:162:0: style: The function 'moveFolder' is never used. [unusedFunction] + +^ +sources/storage/FileHandler.cpp:203:0: style: The function 'removeFiles' is never used. [unusedFunction] + +^ +sources/storage/FileHandler.cpp:183:0: style: The function 'removeFolder' is never used. [unusedFunction] + +^ +sources/storage/FileHandler.cpp:415:0: style: The function 'subFolders' is never used. [unusedFunction] + +^ +sources/model/MAbstract.cpp:33:0: style: The function 'toVariantList' is never used. [unusedFunction] + +^ +sources/model/settings/MSettings.cpp:68:0: style: The function 'values' is never used. [unusedFunction] + +^ +nofile:0:0: information: Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project's include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config. [missingInclude] +