Commit Graph

552 Commits

Author SHA1 Message Date
chrchr-github 61bd8fddbf
Partial fix for FP mismatchingContainerExpression warning () 2023-11-17 17:12:38 +01:00
Oliver Stöneberg e47300016b
moved some classes/structs into anonymous namespace () 2023-11-16 15:49:41 +01:00
chrchr-github 41bd28c0b3
Fix Library: add Container::Action::FIND_CONST () 2023-10-20 21:22:06 +02:00
Oliver Stöneberg bfe19af6b2
fixed some "Declaration and assignment can be joined" Rider warnings () 2023-10-18 10:06:17 +02:00
Oliver Stöneberg 85fe627c68
fixed some typos () 2023-10-17 18:32:07 +02:00
Oliver Stöneberg 5e89eb05a6
iwyu.yml: made `include-what-you-use` output more verbose / cleaned up includes () 2023-10-16 12:57:49 +02:00
chrchr-github f13134a6a4
Refactoring: use init list, redundant init () 2023-10-15 14:51:12 +02:00
chrchr-github 179d26f06b
Fix FP useStlAlgorithm with loop over initializer list () 2023-10-12 10:06:52 +02:00
chrchr-github e247e818ec
Fix FP: containerOutOfBounds () 2023-10-11 14:08:17 +02:00
Oliver Stöneberg a22c181553
fixed "Redundant elaborated type specifier" Rider warnings () 2023-10-08 09:10:17 +02:00
Oliver Stöneberg 02b836baad
do not pass POD types by reference (based on clazy `function-args-by-value` check) () 2023-09-11 20:40:39 +02:00
Daniel Marjamäki 276f017fbe
Partial fix for (Safety: show what checks are enabled/disabled) ()
Example output on stdout:
```
$ ./cppcheck m1.cpp 
Checking m1.cpp ...
Active checkers: 59/177
```
2023-08-29 12:00:52 +02:00
Oliver Stöneberg 3cf9100198
fixed (Use std::to_string() in place of MathLib::toString() ...) - deleted default implementation of `Mathlib::toString()` ()
It was also used inconsistently and seemed to imply there is some
special handling which wasn't the case. It was just an alias for
`std::to_string()` for non-`double` types. So there was no need for it.

---------

Co-authored-by: Robert Reif <reif@earthlink.net>
2023-08-17 16:46:32 +02:00
chrchr-github 8d3fd88d3f
Fix FP stlcstr for string in shared_ptr copied elsewhere () 2023-07-10 15:27:33 +02:00
chrchr-github cc38ef4168
Fix FP constParameterReference / FP stlcstrConstructor / FP unknownMacro () 2023-07-07 15:54:07 +02:00
chrchr-github bb962e2bc3
Enable and mitigate readability-else-after-return () 2023-06-20 18:43:21 +02:00
chrchr-github 78c7e3351f
Fix FP negativeContainerIndex after index is validated () 2023-06-20 10:55:14 +02:00
chrchr-github 0ecf101fe3
Fix FN stlcstrConstructor, stlcstrAssignment with std::stringview ()
* Fix  FN stlcstrParam with std::string_view

* Add suppression

* Use emplace()

* Fix  FN stlcstrConstructor, stlcstrAssignment with std::string_view
2023-05-31 16:51:37 +02:00
chrchr-github 17789778c9
Fix FN stlcstrParam with std::string_view ()
* Fix  FN stlcstrParam with std::string_view

* Add suppression

* Use emplace()
2023-05-28 01:11:11 +02:00
chrchr-github ec2a2ad41f
Partial fix for FN variableScope with const member functions () 2023-05-03 10:02:16 +02:00
Oliver Stöneberg b3016f01a1
fixed some CLion inspection warnings ()
* fixed some CLion "Unused global declaration" warnings

* fixed some CLion "Not implemented function" warnings

* fixed some CLion "Unused struct" warnings

* added TODO

* removed unused parameter reported by CLion

* fixed some CLion "Unused macro" warnings

* fixed some CLion "Condition is always true" warnings and a CLion "The value is never used" warning
2023-04-28 16:02:41 +02:00
chrchr-github 35a46dfd00
Fix FN unusedStructMember with member functions, inheritance ()
* Fix  Detect unused Private member variables

* Fix FN unusedStructMember when there are member functions

* Unused member

* Warn for unused private variables in base class

* Warn for private inheritance, add test
2023-04-18 22:30:08 +02:00
Oliver Stöneberg 5be8eee943
iwyu.yml: use a distro which has the latest `include-what-you-use` / enabled Qt mappings / cleaned up includes () 2023-04-08 16:08:47 +02:00
chrchr-github 3ccd0505cd
Enable and mitigate readability-simplify-boolean-expr () 2023-03-17 13:51:55 +01:00
chrchr-github a6c5bb28c1
Fix crash in LoopAnalyzer () 2023-03-13 15:44:34 +01:00
Paul Fultz II 61e8b84578
Fix 11610: false negative: knownConditionTrueFalse with address of variable () 2023-03-12 19:57:11 +01:00
chrchr-github a75392307f
Partial fix for : no DacaWrongData for function pointer () 2023-03-12 15:49:37 +01:00
Paul Fultz II 9351eddbca
Fix 11605: FN useStlAlgo with multiple conditions () 2023-03-09 17:06:27 +01:00
chrchr-github 9291421840
Fix FN useStlAlgorithm with complex condition () 2023-03-04 11:58:12 +01:00
chrchr-github 50c8a0dbe1
Fix pop_back on empty container is UB () 2023-02-24 01:10:19 +01:00
Paul Fultz II 346ecdb53a
Improve valueflow after pushing to container () 2023-02-23 18:05:31 +01:00
chrchr-github 8af1026696
Set functions for calls through iterators () 2023-02-07 21:57:59 +01:00
chrchr-github 5818520b4b
Fix FN stlcstrAssignment () 2023-02-03 14:10:27 +01:00
Oliver Stöneberg afd13ea11d
ValueFlow: some interface and namespace cleanups () 2023-01-28 10:20:47 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg a09667a6d9
removed unused error messages () 2023-01-07 10:35:39 +01:00
Oliver Stöneberg 1cfe49e340
use `const_iterator` where possible () 2022-12-30 15:13:47 +01:00
chrchr-github b1abaf8809
Fix FP useStlAlgorithm (don't suggest std::accumulate when nothing is accumulated) () 2022-12-18 16:52:04 +01:00
chrchr-github 3273e51fd5
Fix FN useStlAlgorithm with iterators () 2022-10-16 13:46:26 +02:00
Oliver Stöneberg cff1cd9cda
applied clang-tidy `misc-const-correctness` fixes for POD types, iterators and references ()
* 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
chrchr-github 586c29c772
Partial fix for False negative: stlOutOfBounds, cast ()
* Fix leakNoVarFunctionCall FP

* Partial fix for  False negative: stlOutOfBounds, cast
2022-09-30 14:43:21 +02:00
chrchr-github 13e8d5220c
Fix another c_strParam regression () 2022-08-23 20:26:36 +02:00
chrchr-github 4be7f689d7
Fix c_strParam regression ()
* Fix  New check: Not needed c_str() operation

* Comment

* Detect more instances of c_str() misuse

* Fix bad merge

* Check for data() also

* Fix

* Format

* Format

* Fix c_strParam regression
2022-08-23 15:00:27 +02:00
chrchr-github 66fca7ba91
Detect more instances of c_str() misuse ()
* Fix  New check: Not needed c_str() operation

* Comment

* Detect more instances of c_str() misuse

* Fix bad merge

* Check for data() also

* Fix

* Format

* Format
2022-08-22 14:06:10 +02:00
chrchr-github d351a97a0f
Fix FN stlcstrParam ()
* Fix  New check: Not needed c_str() operation

* Comment

* Fix error messages

* Handle more complex string expressions

* Fix  FN stlcstrParam

* Handle iterators

* Format

* Format

* Parentheses
2022-08-21 13:04:43 +02:00
chrchr-github b04bf7396f
Fix New check: Not needed c_str() operation () 2022-08-20 20:52:10 +02:00
Oliver Stöneberg 1d95d1908d
refs - sped up `Library::detectContainerOrIterator()` by iterating the containers only once () 2022-08-20 12:14:55 +02:00
Paul Fultz II 6cb3a79a64
Fix 11147: FP invalidContainer with substr() ()
* Fix 11147: FP invalidContainer with substr()

* Format
2022-08-03 19:04:44 +02:00
Oliver Stöneberg efaaa58896
fixed some `modernize-use-emplace` false negatives and some `bugprone-assignment-in-if-condition` warnings () 2022-07-28 22:53:59 +02:00
chrchr-github 79f091c59a
Fix uselessCallsConstructor TODOs ()
* Fix uselessCallsConstructor TODOs

* Format
2022-07-21 22:15:16 +02:00