KDAB / KDStateMachineEditor

A framework for creating Qt State Machine metacode using a graphical user interface
https://kdab.github.io/KDStateMachineEditor/
171 stars 31 forks source link

PVS-Studio issues #25

Open nmariusp opened 2 years ago

nmariusp commented 2 years ago

I have Kubuntu 22.04. I have installed Qt5 using kdesrc-build. I have built https://github.com/KDAB/KDStateMachineEditor using this Qt. Pseudocode:

git clone https://github.com/KDAB/KDStateMachineEditor
cd KDStateMachineEditor && mkdir build && cd build

export CMAKE_PREFIX_PATH=/home/n/kde/qt5:/home/n/kde/usr
export XDG_DATA_DIRS=/home/n/kde/usr/share:/usr/share/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop
export PKG_CONFIG_PATH=/home/n/kde/usr/lib/pkgconfig:/home/n/kde/qt5/lib/pkgconfig
export PATH=/home/n/kde/usr/bin:/home/n/kde/qt5/bin:/home/n/kde/src/kdesrc-build:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
export CMAKE_MODULE_PATH=/home/n/kde/qt5/lib/cmake:/home/n/kde/usr/lib64/cmake:/home/n/kde/usr/lib/cmake
export LD_LIBRARY_PATH=/home/n/kde/usr/lib:/home/n/kde/qt5/lib

cmake -B . -S .. -G Unix\ Makefiles -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS:STRING=-pipe -DCMAKE_INSTALL_PREFIX=/home/n/kde/usr -DCMAKE_PREFIX_PATH=/home/n/kde/qt5
pvs-studio-analyzer trace -- make # Instead of make -j `nproc`

pvs-studio-analyzer analyze -l /path/to/PVS-Studio.lic -o PVS-Studio.log

plog-converter -a GA:1,2 -d V1042,V1053,V1044 -t tasklist -o report.tasks PVS-Studio.log

The file report.tasks can be opened with Qt Creator. File > Open File or Project. It will be shown in the "Issues" Output Pane (Alt+1).

Below is the file report.tasks:

pvs-studio.com/en/docs/warnings/    1   err Help: The documentation for all analyzer warnings is available here: https://pvs-studio.com/en/docs/warnings/.
/home/n/kde/misc/KDStateMachineEditor/build/src/core/kdstatemachineeditor_core_autogen/NLOY5YBGEN/moc_state.cpp 819 warn    V1048 The '* reinterpret_cast< Kind * > (_v)' variable was assigned the same value.
/home/n/kde/misc/KDStateMachineEditor/build/src/debuginterface/debuginterfacesource/rep_debuginterface_source.h 84  warn    V730 Not all members of a class are initialized inside the constructor. Consider inspecting: m_signalArgCount, m_methodArgCount.
/home/n/kde/misc/KDStateMachineEditor/build/src/view/kdstatemachineeditor_view_autogen/LTLVFUOEFO/moc_commandfactory_p.cpp  210 warn    V1037 Two or more case-branches perform the same actions. Check lines: 210, 224
/home/n/kde/misc/KDStateMachineEditor/build/src/view/kdstatemachineeditor_view_autogen/EWIEGA46WW/moc_editcontroller.cpp    110 warn    V1037 Two or more case-branches perform the same actions. Check lines: 110, 117
/home/n/kde/misc/KDStateMachineEditor/src/app/mainwindow.cpp    160 err V547 Expression 'mode == PresetsInputMode' is always true.
/home/n/kde/misc/KDStateMachineEditor/src/core/layout/graphvizlayout/graphvizlayouterbackend.cpp    73  warn    V785 Constant expression in switch statement.
/home/n/kde/misc/KDStateMachineEditor/src/core/model/element.cpp    179 warn    V1037 Two or more case-branches perform the same actions. Check lines: 179, 188
/home/n/kde/misc/KDStateMachineEditor/src/core/model/elementutil.cpp    31  err V547 Expression is always true.
/home/n/kde/misc/KDStateMachineEditor/src/core/model/elementutil.cpp    48  err V547 Expression is always true.
/home/n/kde/misc/KDStateMachineEditor/src/core/model/state.cpp  38  warn    V785 Constant expression in switch statement.
/home/n/kde/misc/KDStateMachineEditor/build/src/debuginterface/debuginterfacesource/kdstatemachineeditor_debuginterfacesource_autogen/include/qsmdebuginterfacesource.moc   110 warn    V1037 Two or more case-branches perform the same actions. Check lines: 110, 117
/home/n/kde/misc/KDStateMachineEditor/src/view/command/modifyelementcommand.cpp 115 err V501 There are identical sub-expressions to the left and to the right of the '&&' operator: m_item && m_item
/home/n/kde/misc/KDStateMachineEditor/src/view/quick/quicksceneitem.cpp 164 warn    V601 The bool type is implicitly cast to the double type. Inspect the first argument.
/home/n/kde/misc/KDStateMachineEditor/src/view/semanticzoommanager.cpp  99  warn    V657 It's odd that this function always returns one and the same value.
/home/n/kde/misc/KDStateMachineEditor/src/view/statemachinescene.cpp    326 warn    V657 It's odd that this function always returns one and the same value.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  159 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  172 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  192 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  205 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  218 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  234 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  253 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  278 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/tests/test_commands.cpp  292 err V773 The function was exited without releasing the 'cmd' pointer. A memory leak is possible.
/home/n/kde/misc/KDStateMachineEditor/src/view/widgets/statemachinetoolbar.cpp  144 err V773 Visibility scope of the 'exporter' pointer was exited without releasing the memory. A memory leak is possible.