Closed cchambers1982 closed 6 years ago
Can't inspect precisely right now (away), but there are some questions:
Also note that plugin analyzes header files explicitly, while cppcheck-gui only processes them if they are included in some checked source (if i remember right). So plugin should always work slower then cppcheck-gui.
I'll be able to check it by myself only some days later.
Hey Sergey,
Thanks for your response. To answer your questions:
4.3.0: Starting CppChecker with:C:/Program Files (x86)/Cppcheck/cppcheck.exe, --enable=warning,style,performance,portability,information,missingInclude,unusedFunction --template={file},{line},{severity},{id},{message} --file-list=C:/Users/cchambers/AppData/Local/Temp/qtcreator.H17816 --includes-file=C:/Users/cchambers/AppData/Local/Temp/qtcreator.I17816
4.5.0: Starting CppChecker with:C:/Program Files (x86)/Cppcheck/cppcheck.exe, --enable=warning,style,performance,portability,information,missingInclude,unusedFunction --template={file},{line},{severity},{id},{message} --file-list=C:/Users/cchambers/AppData/Local/Temp/qtcreator.B16232 --includes-file=C:/Users/cchambers/AppData/Local/Temp/qtcreator.H16232
By input files, I assume you mean the temp files on the command line. I checked both and they are identical between 4.3.0 and 4.5.0. Both file list contains around 1600 files and the include file list is empty in both cases.
I don't believe the plugin is utilising multiple threads in either version, as I don't see a -j command line argument. The GUI is using one thread:
...so I would have thought they'd be comparable.
I also take your point about the plugin being slower than the GUI, however, considering the plugin at 4.3.0 and the GUI operate at roughly the same speed but 4.5.0 is much, much slower than both I'd say it's more likely there's an issue with the 4.5.0 plugin.
Thank you again for your input.
Just checked it. 4.3.0 and 4.5.0 works same for me. Unfortunately both are slow on large codebase (qt-creator) :(
But there are some nuances:
*.h
or similar filter to plugin's ignored files setting. After i've done this, files list became almost the same as in cppcheck-gui.--includes-file=...
) and check speed became comparable with cppcheck-gui. But without specifying those include paths, cppcheck can ignore some errors.So, back to your situation. Was includes file really empty in both cases (4.3.0/4.5.0)? It should be filled with directories, containing checked files. If it was empty - i don't know how to reproduse your issue. If not - it explains long file processing (cppcheck have to check a lot of paths to find (or not) includes). But doesn't lead to proper sollution, since that file is here for a reason :)
Hi Sergey. So sorry for the delay in responding to you.
Thank you for the hints. I added the exclusion for header files but it didn't appear to exclude them during the check, and indeed was still very slow to process.
I was sure that includes-files was empty last time, but I just re-checked and this time it's not so perhaps I made a mistake somewhere along the line. There are some 70 lines of directory paths in there now, all part of my solution.
Hello again.
I'll dig into cppcheck's sources later. Maybe then i'll find the way to handle such situations properly.
Ignore patterns
means that matched files will not be passed to cppcheck cli. But if one of passed files uses (includes) some of them, cppcheck will check it anyway.
Btw check for unused functions
disables threading.
Try this version. Changes:
Hi Sergey, this version is much, much faster! Thank you.
@cchambers1982 I have the error: C:\Qt\Qt5.7.0\Tools\QtCreator-4.5.0\lib\qtcreator\plugins\QtcCppcheck4.dll: Cannot load library C:\Qt\Qt5.7.0\Tools\QtCreator-4.5.0\lib\qtcreator\plugins\QtcCppcheck4.dll: Unknown error 0x000000c1.
What is wrong? I use Qt Creator 4.5.0 and I've downloaded QtcCppcheck-4.5.0-win1.zip.
@prepas Hi. Looks like there is something wrong with your Qt version. Qt Creator 4.5.0 is build with Qt 5.10, but it tries to load 5.7 version. Have you installed it via qt online installer? I test plugins only for that version.
No, I use Qt Creator 4.5.0 & Qt 5.7.0
If you use qt creator different to one from qt online installer, then you likely should rebuild plugin by yourself.
I took the 4.5.0 release for Windows and integrated it with Qt Creator 4.5.0 (x86) and CppCheck v1.81 on Windows 10 (x64). The analysis is notably slower than with 4.3.0 and the same version of CppCheck, and with the CppCheck GUI. Both of those take around 10 minutes with my solution, but with v4.5.0 I gave up after 20 minutes at 10% done.