Commit Graph

1284 Commits

Author SHA1 Message Date
Oliver Stöneberg e5721030ca
greatly sped up `dmake` (#4630)
* dmake.cpp: use `endsWith()` in `getCppFiles()`

* dmake.cpp: optimized string concatenation in `getDeps()`

* dmake.cpp: avoid duplicated `std::string::find()` in `getDeps()`

* dmake.cpp: no need to get dependencies of headers without `.h` extension in `getDeps()`

* dmake.cpp: do not try to look for file in `externals` folder which does not contain any headers in `getDeps()`
2022-12-17 09:13:31 +01:00
Rikard Falkeborn ac525531d9
test-my-pr, mark --c-only and --cpp-only mutually exclusive (#4628)
It makes no sense to specify both arguments at the same time.
2022-12-11 19:41:21 +01:00
Daniel Marjamäki 883908b439 triage tool: handle reports when cppcheck is run on local packages 2022-12-01 06:34:23 +01:00
Oliver Stöneberg 67f46b7353
donate-cpu: avoid unnecessary build invocation for `main` (#4596) 2022-11-28 20:49:05 +01:00
Oliver Stöneberg 01abf4c347
fixed macos build by manually installing `pcre` (#4597)
* Makefile: bail out if `pcre-config` is missing

* CI-unixish.yml: install `pcre` for `macos` via `brew` since it suddenly disappeared from the runner images
2022-11-25 15:11:57 +01:00
Oliver Stöneberg f6c2afa2ea
fix #10159 - donate-cpu: collect and avoid packages with no files to process (#4498) 2022-11-23 19:13:54 +01:00
Oliver Stöneberg a7dde5d470
donate-cpu: improved client stability by consistently re-trying remote calls / cleanups (#4545) 2022-11-20 14:47:19 +01:00
Oliver Stöneberg e235297a14
donate-cpu-server.py: improved error handling and reporting / some cleanups (#4534) 2022-11-20 13:10:43 +01:00
Armin Müller 7f74aad8e2
Typos found by running "codespell" (#4578) 2022-11-09 22:52:03 +01:00
omarandlorraine 6488650d24
use python3 on debians too (#3812)
* use python3 on debians too

in Debian 11 which is Bullseye, /usr/bin/python is a Python2
interpreter, which means that cppcheck-htmlreport fails to run here.
So I've chenged the shebang to use python3

* change all shebangs from python to python3

Co-authored-by: Sam M W <smw@alertergroup.co.uk>
2022-11-03 22:14:30 +01:00
Oliver Stöneberg 12afb9bbf4
cleaned up global `donate_cpu_lib.py` configuration variables (#4532) 2022-10-06 20:49:47 +02:00
Oliver Stöneberg 6634cb95a1
matchcompiler.py: declare matchcompiled functions as `inline` (#4536) 2022-10-06 07:58:48 +02:00
Oliver Stöneberg cff1cd9cda
applied clang-tidy `misc-const-correctness` fixes for POD types, iterators and references (#4529)
* applied `misc-const-correctness` fixes for POD types and iterators

* applied `misc-const-correctness` fixes for references
2022-10-02 07:12:40 +02:00
Oliver Stöneberg 858585ceb1
disabled all clang-tidy checks for Qt generated files (#4525)
* disabled cll clang-tidy checks for Qt generated files

* enabled `bugprone-suspicious-include` clang-tidy warning
2022-09-30 07:27:03 +02:00
Oliver Stöneberg 40b5521bf0
added `triage_version.py` for running a code sample against a given amount of Cppcheck binaries (#4332) 2022-09-29 22:01:17 +02:00
Oliver Stöneberg 0ab7116891
refs #10700 - donate-cpu-server.py: added query parameter `pkgs` to some reports to request a list of affected packages (#3743) 2022-09-29 21:55:44 +02:00
Oliver Stöneberg d6f1d7bb23
replaced `static const`/fixed `std::vector` containers with `std::array` (#4440) 2022-09-27 20:06:15 +02:00
Oliver Stöneberg 1a464ec5ab
donate-cpu-server.py: some minor improvements and cleanups (#4492)
* donate-cpu-server.py: bumped version

* donate-cpu-server.py: adjusted some variables names

* donate-cpu-server.py: small date string parsing improvement

* donate-cpu-server.py: added timestamp to all messages

* donate-cpu-server.py: bail out if `donated-results` folder is missing

* donate-cpu-server.py: use more detailed timestamp in logging

* donate-cpu-server.py: use `with` scopes
2022-09-22 21:20:38 +02:00
Oliver Stöneberg 21db0b98a6
donate-cpu: small `LibraryIncludes` regular expression improvements / fixed/improved tests (#4473)
* test_donate_cpu_lib.py: added more tests

* test_donate_cpu_lib.py: fixed non-working assert

* donate_cpu_lib.py: use `\t` in `LibraryIncludes` regular expressions instead of an actual TAB character

* donate_cpu_lib.py: bumped version

* donate_cpu_lib.py: use non-capturing group in `LibraryIncludes` regular expressions
2022-09-16 18:59:53 +02:00
Oliver Stöneberg 339484d2a1
mitigated and enabled more clang-tidy warnings (#4470)
* fixed some `performance-inefficient-string-concatenation` clang-tidy warnings

* fixed and enabled `modernize-replace-random-shuffle` clang-tidy warning

* fixed and enabled `bugprone-suspicious-string-compare` clang-tidy warning

* mitigated and enabled `readability-non-const-parameter` clang-tidy warnings

* clang-tidy.md: documented some disabled checks

* mitigated and enabled `performance-unnecessary-value-param` clang-tidy warnings
2022-09-16 18:58:59 +02:00
Oliver Stöneberg 76244de640
daca: add checkLibraryCheckType report / bumped client version (#4457) 2022-09-15 20:21:40 +02:00
Oliver Stöneberg a556cc3863
donate-cpu: collect some `--debug-warnings` (#4422) 2022-09-09 20:56:14 +02:00
Oliver Stöneberg 9542a7b3cc
Makefile: some cleanups / added `VERBOSE` option (#4438) 2022-09-09 15:06:40 +02:00
Oliver Stöneberg 54771306c5
selfcheck : cleaned up some suppressions, fixed warnings and some cleanups (#4436)
* cleaned up triage.pro and pass all triage files to selfcheck

* CI-unixish.yml: factored out redundant selfcheck flags

* CI-unixish.yml: cleaned up selfcheck suppressions and fixed warnings

* added explicit `missingInclude` checks to selfcheck to work around current issues/limitations / fixed selfcheck includes / added some unit tests for `missingInclude`

* applied the selfcheck changes to the sanitizer jobs

* only fail TSAN CI build in case of TSAN error / updated sanitizer CI build TODOs
2022-09-06 23:11:39 +02:00
Daniel Marjamäki 251de269ec test-my-pr: fix syntax error 2022-09-05 20:55:55 +02:00
Daniel Marjamäki cf334100b6 test-my-pr: fix syntax error 2022-09-05 20:21:26 +02:00
Daniel Marjamäki 2e7babbc8d test-my-pr: if there are crashes then dont compare results and timings 2022-09-05 20:17:38 +02:00
Daniel Marjamäki 4401eba3fa test-my-pr: show libraries in log output 2022-09-05 16:27:07 +02:00
Daniel Marjamäki 7bb2bd3ca0 test-my-pr: add option --c-only 2022-09-05 11:33:32 +02:00
Daniel Marjamäki 7046687fce test-my-pr: the check_requirements must be called otherwise __make_cmd is not set 2022-09-02 18:02:11 +02:00
Oliver Stöneberg 9d107d911b
fixed #11276 (donate-cpu: Improve library detection) (#4421) 2022-08-30 18:08:02 +02:00
Daniel Marjamäki 4a4f69110e daca@home: update OLD_VERSION 2022-08-28 17:21:13 +02:00
Oliver Stöneberg cee04f4ee5
donate-cpu: fixed `make` build / cleanups (#4398) 2022-08-25 22:20:30 +02:00
Oliver Stöneberg 9cd9afa1b6
donate-cpu: added support for `mingw32-make` and improved support for `msbuild.exe` (#4352) 2022-08-21 17:08:58 +02:00
Oliver Stöneberg 32c0167eab
specify `-pipe` for GCC to use pipes instead of temporary files - greatly reduces I/O usage (#4360) 2022-08-16 22:12:01 +02:00
Oliver Stöneberg 31d704e4bc
cppcheckexecutor.cpp: extracted platform-dependent code into separate files (#4359) 2022-08-16 22:03:44 +02:00
Oliver Stöneberg 271213cbbd
added make target `validatePlatforms` to CMake (#4343)
* added missing `platforms/cppcheck-platforms.rng` validation

* added make target `validatePlatforms` to CMake
2022-08-06 19:56:32 +02:00
Oliver Stöneberg 30b20d17cb
donate-cpu: some cleanups (#4291)
* donate_cpu_lib.py: bumped version

* donate-cpu.py: replaced `version.StrictVersion` from deprecated `distutils` with `version.Version` from `packaging`

* donate_cpu_lib.py: omit `-rp=` from `cppcheck-options`

* donate-cpu.py: use `get_client_version()` instead of constant
2022-07-19 07:52:23 +02:00
Oliver Stöneberg 7ee450ed21
donate-cpu.py: fixed stupid mistakes in client version update notification (#4290) 2022-07-18 23:10:33 +02:00
Oliver Stöneberg cc9c5a2768
donate-cpu.py: added `--version` and show a message when a newer client is available (#4288) 2022-07-18 16:24:04 +02:00
Oliver Stöneberg bc58f55c6e
donate-cpu: greatly improved `LibraryIncludes.get_libraries()` performance / some optimizations and cleanups (#4273)
* donate_cpu_lib.py: use `os.path.join()`

* donate-cpu: removed remaining usage of `os.chdir()`

* donate_cpu_lib.py: moved library includes code into class

* donate_cpu_lib.py: pre-compile library include regular expressions

* donate_cpu_lib.py: pre-compile some more regular expressions

* donate_cpu_lib.py: small unpack_package() cleanup and optimization

* donate_cpu_lib.py: added some information about the extracted files to unpack_package()

* donate_cpu_lib.py: bumped version

* added test_donate_cpu_lib.py

* donate_cpu_lib.py: greatly improved `LibraryIncludes.get_libraries()` performance

only scan each file once for previously undetected libraries only

* test_donate_cpu_lib.py: fix for Python 3.5

* scriptcheck.yml: added `-v` to pytest calls so we get the complete diff on assertions

* fixed `test_arguments_regression()` Python tests with additional pytest arguments

* donate_cpu_lib.py: use `subprocess.check_call()`

* test_donate_cpu_lib.py: sort results to address differences in order with Python 3.5
2022-07-13 21:09:29 +02:00
chrchr-github 21d992cc00
Fix crash on Windows with -j option (#4229)
* Fix crash on Windows with -j option

* Disable CI-cygwin workflow

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Try to fix Cygwin build

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Cygwin uses THREADING_MODEL_FORK

* Restore workflows

* Remove comment

* Fix dmake

* Fix #11179 FP invalidFunctionArgStr

* Revert "Fix #11179 FP invalidFunctionArgStr"

This reverts commit dd5d3e67c6.
2022-07-13 13:46:03 +02:00
Oliver Stöneberg 1d9b6e1aac
donate-cpu: fixed library detection (#4261) 2022-07-12 19:39:07 +02:00
Oliver Stöneberg e8b0f12367
replaced `if(MATCHES)` with `if(STREQUAL)` (#4263)
`MATCHES` does regular expression matching which is not the intended behavior here. `Clang` still requires it since it also needs to match `AppleClang.
2022-07-11 10:46:18 +02:00
Armin Müller 0ae9877766
Typos found by running "codespell" (#4260) 2022-07-10 22:40:05 +02:00
Oliver Stöneberg c9c1f83a69
use `emptyString` more consistently (#4034) 2022-07-10 10:57:29 +02:00
Oliver Stöneberg b51aea5531
separated process execution code into `ProcessExecutor` (#4249) 2022-07-08 16:42:57 +02:00
orbitcowboy 10c7c70970 Activated 'make validateRules' and improved rule XML file parsing. Now, it optionally accepts '<rules>...</rules>' tags to make xmllint happy. 2022-06-22 00:03:18 +02:00
orbitcowboy 49ffe80f75 Decativate 'make validateRules' 2022-06-21 17:14:53 +02:00
orbitcowboy 6f303ce61c daca@home: Set '--inline-suppr' flag. 2022-06-21 16:18:12 +02:00
Paul Fultz II 2a0b2f538e
Check tokType in match compiler (#4219)
* Check tokType in match compiler

* Set keyword when tokenlist is missing
2022-06-18 21:30:42 +02:00
Rikard Falkeborn e7b5a776bd
Matchcompiler: Add missing makeConstString (#4179) 2022-06-08 09:24:20 +02:00
Oliver Stöneberg d299d22fa2
updated CI to latest ubuntu and clang (#4004) 2022-05-22 15:27:32 +02:00
Daniel Marjamäki 98f9fd0d8f daca@home: update old-version and server script version 2022-05-21 19:09:10 +02:00
Daniel Marjamäki 31560299f8 donate-cpu: skip torture test file 2022-05-20 23:20:16 +02:00
Oliver Stöneberg c71033548f
fixed some clang-tidy warnings (#3080) 2022-05-08 20:42:06 +02:00
orbitcowboy a6b8bb5950 donate_cpu: Added '<sys/uio.h>' to bsd include list. 2022-04-26 09:46:18 +02:00
Oliver Stöneberg 36ef4dc5b8
added support for Qt6 (#3930) 2022-04-15 18:49:24 +02:00
Oliver Stöneberg 32978933b5
removed leftovers of generated cfg tests (#4008) 2022-04-13 12:24:17 +02:00
Oliver Stöneberg 902f46bae5
some minor QRegularExpression usage optimizations and cleanups (#3999) 2022-04-11 19:15:42 +02:00
Daniel Marjamäki 8f386e15fd Remove bug hunting. This feature will be provided in Cppcheck premium. 2022-04-11 07:31:33 +02:00
chrchr-github bd9f5231b8
Fix #10179 FP divideSizeof with dereferenced pointer-to-pointer (#3786) 2022-04-10 22:47:27 +02:00
Oliver Stöneberg a0bab85bf9
ported GUI code from QRegExp to QRegularExpression (#3785) 2022-03-23 18:16:22 +01:00
Oliver Stöneberg dcaff3b635
donate_cpu_lib.py: some cleanups (#3916) 2022-03-21 18:46:19 +01:00
Oliver Stöneberg 18d24e2420
reduce.py: some fixes (#3914)
* reduce.py: fixed potential "TypeError: slice indices must be integers or None or have an __index__ method" in combinelines()

* reduce.py: the combinelines() changes were not applied when the chunk mode was used
2022-03-21 17:14:47 +01:00
chrchr-github 0e147502cc
Fix #10888 FN variableScope with enum and struct (#3920)
* Fix #10888 FN variableScope with enum and struct

* Scope reduction

* Scope reduction
2022-03-21 16:05:38 +01:00
Oliver Stöneberg 469575cb21
donate_cpu_lib.py: actually make compile_cppcheck() fail when the build fails / some cleanups (#3830) 2022-03-19 20:06:11 +01:00
Oliver Stöneberg 8fc5c93803
refactored reduce.py into a class and added unit test for it (#3791) 2022-03-19 19:42:44 +01:00
Oliver Stöneberg 0d336b868c
avoid some Clang compiler warnings (#3896) 2022-03-13 20:07:58 +01:00
Oliver Stöneberg e208fc67c1
small selfcheck improvements (#3888)
* CI-unixish.yml: added missing cppcheck-lib library to GUI selfcheck

* CI-unixish.yml: split triage from tools selfcheck since it requires the qt library

* replaced Q_NULLPTR with nullptr

* fixed passedByValue selfcheck warning
2022-03-11 21:42:46 +01:00
Daniel Marjamäki bfdfe1e607 run-coverity: updated coverity tool 2022-02-18 19:55:45 +01:00
Oliver Stöneberg aaa4425d90
added MinGW to CI and fixed local MinGW build (#3826) 2022-02-16 07:06:04 +01:00
Oliver Stöneberg d3ba5a0829
donate-cpu.py: added "--packages" parameter to specify a list of packages to process (#3742) 2022-02-14 12:59:38 +01:00
Oliver Stöneberg c690bfb03a
matchcompiler.py: skip comments in _replaceTokenMatch() (#3825) 2022-02-11 21:20:55 +01:00
Oliver Stöneberg 04b2a6f1c5
use Python version provided by platform in CI / prefer python3 (#3776) 2022-02-11 19:37:32 +01:00
Oliver Stöneberg d528555002
some preparations for Qt6 support (#3777)
* findDependencies.cmake: cleaned up find_package() call for Qt

* some CMake preparations for Qt6 support

* some Qt6 compilation fixes
2022-02-07 17:35:25 +01:00
Daniel Marjamäki b19010159c 2.7: update daca@home version 2022-02-05 14:00:25 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Paul Fultz II 508fa6284c
Python fixes for reduce.py (#3795) 2022-02-05 08:32:01 +01:00
Oliver Stöneberg 58f9672ff4
cleaned up GUI includes based on include-what-you-use (#3792) 2022-02-02 22:31:51 +01:00
Oliver Stöneberg 9d36dd56a8
reordered includes in GUI code (#3790) 2022-02-02 16:17:28 +01:00
Oliver Stöneberg a03d754d19
more copyright fixes (#3771) 2022-01-28 18:30:12 +01:00
Oliver Stöneberg 38420c8ecf
added some more missing copyright headers (#3766) 2022-01-28 15:56:11 +01:00
Oliver Stöneberg 8764110562
donate-cpu-server.py: added daca errors to important errors in overview (#3761) 2022-01-27 17:54:44 +01:00
Rikard Falkeborn d105f3b05f
Minor improvements to package selection in test-my-pr/donate-cpu (#3754) 2022-01-26 11:36:58 +01:00
Oliver Stöneberg be73eb3c7c
donate-cpu-server.py: added links to some important errors to overview (#3731) 2022-01-21 15:46:29 +01:00
Oliver Stöneberg 34317f86ab
reduce.py: several improvements (#3701) 2022-01-13 07:52:47 +01:00
Oliver Stöneberg 4f508c93c4
reduce.py: improved --segfault / added detection of "hang" caused by reduced code / cleanups (#3693) 2022-01-12 22:26:32 +01:00
guillaume-uH57J9 dfd22919bc
donate_cpu_lib.py: fix callstack capture, fix dependency check (#3665)
* donate_cpu_lib.py: fix callstack capture, fix dependency check

check_requirements: verify that module psutil is available. 
scan_package: collect crash callstack regardless of cppcheck_path and cppcheck version

* donate_cpu_lib.pu: remove debug code

* donate_cpu_lib.py: add parameter capture_callstack
2022-01-02 22:16:00 +01:00
Daniel Marjamäki 4d5ad5e42e triage: make it possible to copy selected results 2021-12-22 18:58:11 +01:00
guillaume-uH57J9 a3560aaf5a
Better git usage in donate-cpu.py to reduce bandwidth and disk usage (#3584)
* Better git usage in donate-cpu.py to reduce bandwidth and disk usage

Main changes:
* Bump client version
* Move try+retry logic to function try_retry to reduce duplication
* Use exponential backoff for try_retry
* git clone with --depth=1 to reduce bandwidth and disk use
* Use multiple worktree to work with multiple versions, instead of back-and-forth checkouts

* donate-cpu.py fixes for review comments and automated check failures

* Move compile_cppcheck within (if ver == 'main) branch to avoid duplicate compile_cppcheck+compile_version cals
* Use classic format syntax for python 3.5 compatibility
* Fix undefined CalledProcessError detected by pylint

* donate-cpu.py code changes following code review

* Migration existing "cppcheck" directory if available instead of "git clone"
* Logging message tweaks
* Use subprocess' cwd parameter instead of os.chdir() to avoid risk around changing and not restoring the working directory

* Update tools/test-my-pr.py to account for donate_cpu_lib changes

* donate-cpu.py: ensure correct workspace locations with relative --work-path
2021-12-19 18:52:36 +01:00
Rikard Falkeborn 5fd17ef2c2
test-my-pr: Allow to specify packages to process (#3605) 2021-12-05 20:25:38 +01:00
Oliver Stöneberg 54d621555d
scan GUI sources with clang-tidy in CI (#3233)
* build UI dependencies before running clang-tidy

* clang-tidy.yml: enabled GUI sources and build some dependencies for clang-tidy

* work around missing dependency for Qt install step
2021-10-31 20:15:32 +01:00
Paul Fultz II 8c9c46835a
Fix for 6597: false negative: uninitialized variable usage not detected (ValueFlow , multi variables) (#3535) 2021-10-30 22:13:58 +02:00
Oliver Stöneberg b4704ba065
use target-specific configuration instead of global ones in CMake (#3534) 2021-10-30 09:08:07 +02:00
Oliver Stöneberg 7004ceb691
donate_cpu_lib.py: fixed detection of ThreadExecutor error (#3521) 2021-10-24 11:02:51 +02:00
Oliver Stöneberg 90ba25a6bc
donate-cpu-server.py: another function compression improvement for stack trace overview in crash report (#3520) 2021-10-24 11:01:48 +02:00
Oliver Stöneberg c49d246303
donate-cpu-server.py: improved function compression in stack trace overview of crash report (#3513) 2021-10-18 07:25:31 +02:00
Oliver Stöneberg 48d5f47e73
Fix #10509 (donate_cpu_lib.py: fixed stupid error in lookup of signal in internal error) (#3503) 2021-10-13 14:51:56 +02:00
Oliver Stöneberg 85b02e4ecb
Fix #10509 (improved signal detection daca@home client) / also optimized stack trace generation (#3157) 2021-10-11 19:07:19 +02:00