Mark constructors as explicit to conform to the C++ standard#15
Mark constructors as explicit to conform to the C++ standard#15
Conversation
These constructors fall into the guideline of constructors that should be marked explicit. They are converting constructors that are not intended to be used for implicit conversions and copy-initialization. See https://en.cppreference.com/w/cpp/language/explicit From that site: Specifies that a constructor [or conversion function (since C++11)] [or deduction guide (since C++17)] is explicit, that is, it cannot be used for implicit conversions and copy-initialization. See https://en.cppreference.com/w/cpp/language/converting_constructor also. Enable inline CPPCheck suppressions in the GitHub static analysis workflow and the local CPPCheck command in the CodeLite project for suppressing one instance of noExplicitConstructor where it is intended to be used for implicit conversions and copy-initialization. Add inline suppression to TestCPPUtil.h for noExplicitConstructor. Add --std=c++11 parameter argument to local CPPCheck check in project. Removed unnecessary ignores from the CPPCheck command arguments where it just needs a clean prior to running the cppcheck custom target because the build system it generated probably includes more than what should be analyzed by CPPCheck.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15 +/- ##
=======================================
Coverage 77.36% 77.36%
=======================================
Files 19 19
Lines 561 561
Branches 70 70
=======================================
Hits 434 434
Misses 110 110
Partials 17 17 ☔ View full report in Codecov by Sentry. |
|
⚡ Static analysis result ⚡ 🔴 cppcheck found 18 issues! Click here to see details.TestCPP/include/internal/TestCPPAssertions.h Lines 78 to 83 in 36a11c0 !Line: 78 - performance: Function parameter 'failureMessage' should be passed by const reference. [passedByValue]
TestCPP/include/internal/TestCPPAssertions.h Lines 109 to 114 in 36a11c0 !Line: 109 - performance: Function parameter 'failureMessage' should be passed by const reference. [passedByValue]
TestCPP/include/internal/TestCPPAssertions.h Lines 136 to 141 in 36a11c0 !Line: 136 - performance: Function parameter 'failureMessage' should be passed by const reference. [passedByValue]
TestCPP/include/internal/TestCPPAssertions.h Lines 163 to 168 in 36a11c0 !Line: 163 - performance: Function parameter 'failureMessage' should be passed by const reference. [passedByValue]
TestCPP/src/TestCPPAssertions.cpp Lines 93 to 98 in 36a11c0 !Line: 93 - performance: Function parameter 'failureMessage' should be passed by const reference. [passedByValue]
TestCPP/src/TestCPPAssertions.cpp Lines 108 to 113 in 36a11c0 !Line: 108 - performance: Function parameter 'failureMessage' should be passed by const reference. [passedByValue]
TestCPP/src/TestCPPTestCase.cpp Lines 454 to 459 in 36a11c0 !Line: 454 - performance: Function parameter 'against' should be passed by const reference. [passedByValue]
TestCPP/src/TestCPPTestCase.cpp Lines 459 to 464 in 36a11c0 !Line: 459 - performance: Function parameter 'against' should be passed by const reference. [passedByValue]
TestCPP/src/TestCPPTestCase.cpp Lines 464 to 469 in 36a11c0 !Line: 464 - performance: Function parameter 'against' should be passed by const reference. [passedByValue]
TestCPP/src/TestCPPTestCase.cpp Lines 469 to 474 in 36a11c0 !Line: 469 - performance: Function parameter 'source' should be passed by const reference. [passedByValue]
TestCPP/src/TestCPPTestCase.cpp Lines 469 to 474 in 36a11c0 !Line: 469 - performance: Function parameter 'against' should be passed by const reference. [passedByValue]
TestCPP/src/TestCPPTestCase.cpp Lines 132 to 137 in 36a11c0 !Line: 132 - style: Parameter 'o' can be declared as reference to const [constParameterReference]
TestCPP/src/TestCPPTestCase.cpp Lines 221 to 226 in 36a11c0 !Line: 221 - style: Parameter 'rhs' can be declared as reference to const [constParameterReference]
TestCPP/src/TestCPPTestCase.cpp Lines 279 to 284 in 36a11c0 !Line: 279 - style: Parameter 'reason' can be declared as reference to const [constParameterReference]
TestCPP/include/internal/TestCPPTestSuite.h Lines 81 to 86 in 36a11c0 !Line: 81 - warning: Member variable 'TestSuite::lastRunSucceeded' is not initialized in the constructor. [uninitMemberVar]
TestCPP/include/internal/TestCPPTestSuite.h Lines 81 to 86 in 36a11c0 !Line: 81 - warning: Member variable 'TestSuite::lastRunSuccessCount' is not initialized in the constructor. [uninitMemberVar]
TestCPP/include/internal/TestCPPTestSuite.h Lines 81 to 86 in 36a11c0 !Line: 81 - warning: Member variable 'TestSuite::lastRunFailCount' is not initialized in the constructor. [uninitMemberVar]
TestCPP/include/internal/TestCPPTestSuite.h Lines 81 to 86 in 36a11c0 !Line: 81 - warning: Member variable 'TestSuite::totalRuntime' is not initialized in the constructor. [uninitMemberVar]
🔴 clang-tidy found 149 issues! Click here to see details.TestCPP/src/TestCPPExceptions.cpp Lines 36 to 41 in 36a11c0 !Line: 36 - warning: using decl 'clog' is unused [misc-unused-using-decls]
!Line: 36 - note: remove the usingTestCPP/src/TestCPPExceptions.cpp Lines 38 to 43 in 36a11c0 !Line: 38 - warning: no header providing "std::string" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPExceptions.cpp Lines 39 to 44 in 36a11c0 !Line: 39 - warning: no header providing "std::runtime_error" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPExceptions.cpp Lines 51 to 56 in 36a11c0 !Line: 51 - warning: passing result of std::move() as a const reference argument; no move will actually happen [hicpp-move-const-arg,performance-move-const-arg]
Lines 51 to 56 in 36a11c0 !Line: 51 - warning: implicit conversion 'const char *' -> 'bool' [readability-implicit-bool-conversion]
Lines 59 to 64 in 36a11c0 !Line: 59 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
Lines 63 to 68 in 36a11c0 !Line: 63 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
Lines 64 to 69 in 36a11c0 !Line: 64 - warning: parameter name 's' is too short, expected at least 3 characters [readability-identifier-length]
Lines 78 to 83 in 36a11c0 !Line: 78 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
Lines 83 to 88 in 36a11c0 !Line: 83 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
Lines 89 to 94 in 36a11c0 !Line: 89 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPAssertions.cpp Lines 30 to 35 in 36a11c0 !Line: 30 - warning: no header providing "std::clog" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPAssertions.cpp Lines 31 to 36 in 36a11c0 !Line: 31 - warning: no header providing "std::current_exception" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPAssertions.cpp Lines 33 to 38 in 36a11c0 !Line: 33 - warning: no header providing "std::exception" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPAssertions.cpp Lines 34 to 39 in 36a11c0 !Line: 34 - warning: no header providing "std::__exception_ptr::exception_ptr" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPAssertions.cpp Lines 37 to 42 in 36a11c0 !Line: 37 - warning: no header providing "std::rethrow_exception" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPAssertions.cpp Lines 38 to 43 in 36a11c0 !Line: 38 - warning: no header providing "std::string" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPAssertions.cpp Lines 39 to 44 in 36a11c0 !Line: 39 - warning: no header providing "std::stringstream" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPAssertions.cpp Lines 44 to 49 in 36a11c0 !Line: 44 - warning: the parameter 'shouldThrow' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
TestCPP/src/TestCPPAssertions.cpp Lines 52 to 57 in 36a11c0 !Line: 52 - warning: variable 'eptr' of type 'exception_ptr' can be declared 'const' [misc-const-correctness]
TestCPP/src/TestCPPAssertions.cpp Lines 61 to 66 in 36a11c0 !Line: 61 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPAssertions.cpp Lines 65 to 70 in 36a11c0 !Line: 65 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPAssertions.cpp Lines 79 to 84 in 36a11c0 !Line: 79 - warning: the parameter 'shouldNotThrow' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
TestCPP/src/TestCPPAssertions.cpp Lines 93 to 98 in 36a11c0 !Line: 93 - warning: the parameter 'failureMessage' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
TestCPP/src/TestCPPAssertions.cpp Lines 99 to 104 in 36a11c0 !Line: 99 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPAssertions.cpp Lines 100 to 105 in 36a11c0 !Line: 100 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPAssertions.cpp Lines 108 to 113 in 36a11c0 !Line: 108 - warning: the parameter 'failureMessage' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
TestCPP/src/TestCPPAssertions.cpp Lines 114 to 119 in 36a11c0 !Line: 114 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPAssertions.cpp Lines 115 to 120 in 36a11c0 !Line: 115 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 36 to 41 in 36a11c0 !Line: 36 - warning: no header providing "std::cerr" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 37 to 42 in 36a11c0 !Line: 37 - warning: no header providing "std::clog" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 38 to 43 in 36a11c0 !Line: 38 - warning: using decl 'cout' is unused [misc-unused-using-decls]
!Line: 38 - note: remove the usingTestCPP/src/TestCPPTestSuite.cpp Lines 40 to 45 in 36a11c0 !Line: 40 - warning: no header providing "std::exception" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 41 to 46 in 36a11c0 !Line: 41 - warning: no header providing "std::fixed" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 43 to 48 in 36a11c0 !Line: 43 - warning: using decl 'invalid_argument' is unused [misc-unused-using-decls]
!Line: 43 - note: remove the usingTestCPP/src/TestCPPTestSuite.cpp Lines 45 to 50 in 36a11c0 !Line: 45 - warning: no header providing "std::ostream" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 46 to 51 in 36a11c0 !Line: 46 - warning: no header providing "std::rethrow_exception" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 46 to 51 in 36a11c0 !Line: 46 - warning: using decl 'rethrow_exception' is unused [misc-unused-using-decls]
!Line: 46 - note: remove the usingTestCPP/src/TestCPPTestSuite.cpp Lines 47 to 52 in 36a11c0 !Line: 47 - warning: no header providing "std::runtime_error" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 47 to 52 in 36a11c0 !Line: 47 - warning: using decl 'runtime_error' is unused [misc-unused-using-decls]
!Line: 47 - note: remove the usingTestCPP/src/TestCPPTestSuite.cpp Lines 49 to 54 in 36a11c0 !Line: 49 - warning: no header providing "std::string" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 70 to 75 in 36a11c0 !Line: 70 - warning: no header providing "TestCPP::TestObjName" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestSuite.cpp Lines 74 to 79 in 36a11c0 !Line: 74 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestSuite.cpp Lines 74 to 79 in 36a11c0 !Line: 74 - warning: method 'getLastRunFailCount' can be made const [readability-make-member-function-const]
TestCPP/src/TestCPPTestSuite.cpp Lines 79 to 84 in 36a11c0 !Line: 79 - warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
TestCPP/src/TestCPPTestSuite.cpp Lines 80 to 85 in 36a11c0 !Line: 80 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 89 to 94 in 36a11c0 !Line: 89 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 92 to 97 in 36a11c0 !Line: 92 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 93 to 98 in 36a11c0 !Line: 93 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 102 to 107 in 36a11c0 !Line: 102 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 106 to 111 in 36a11c0 !Line: 106 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 123 to 128 in 36a11c0 !Line: 123 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 129 to 134 in 36a11c0 !Line: 129 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 132 to 137 in 36a11c0 !Line: 132 - warning: variable 'suiteRuntimeElapsed' of type 'double' can be declared 'const' [misc-const-correctness]
TestCPP/src/TestCPPTestSuite.cpp Lines 143 to 148 in 36a11c0 !Line: 143 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestSuite.cpp Lines 152 to 157 in 36a11c0 !Line: 152 - warning: rvalue reference parameter 'test' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
TestCPP/src/TestCPPTestSuite.cpp Lines 165 to 170 in 36a11c0 !Line: 165 - warning: rvalue reference parameter 'test' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
TestCPP/include/internal/TestCPPTestCase.h Lines 131 to 136 in 36a11c0 !Line: 131 - warning: function 'TestCPP::TestCase::TestCase' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
!Line: 101 - note: the definition seen here
!Line: 131 - note: differing parameters are named here: ('testPassedMessage'), in definition: ('msg')TestCPP/include/internal/TestCPPTestCase.h Lines 299 to 304 in 36a11c0 !Line: 299 - warning: function 'TestCPP::TestCase::logTestFailure' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
!Line: 291 - note: the definition seen here
!Line: 299 - note: differing parameters are named here: ('failureMessage'), in definition: ('reason')TestCPP/src/TestCPPTestCase.cpp Lines 43 to 48 in 36a11c0 !Line: 43 - warning: no header providing "std::cerr" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 44 to 49 in 36a11c0 !Line: 44 - warning: no header providing "std::clog" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 45 to 50 in 36a11c0 !Line: 45 - warning: no header providing "std::cout" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 47 to 52 in 36a11c0 !Line: 47 - warning: no header providing "std::exception" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 48 to 53 in 36a11c0 !Line: 48 - warning: no header providing "std::fixed" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 50 to 55 in 36a11c0 !Line: 50 - warning: using decl 'invalid_argument' is unused [misc-unused-using-decls]
!Line: 50 - note: remove the usingTestCPP/src/TestCPPTestCase.cpp Lines 52 to 57 in 36a11c0 !Line: 52 - warning: no header providing "std::rethrow_exception" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 52 to 57 in 36a11c0 !Line: 52 - warning: using decl 'rethrow_exception' is unused [misc-unused-using-decls]
!Line: 52 - note: remove the usingTestCPP/src/TestCPPTestCase.cpp Lines 53 to 58 in 36a11c0 !Line: 53 - warning: no header providing "std::runtime_error" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 53 to 58 in 36a11c0 !Line: 53 - warning: using decl 'runtime_error' is unused [misc-unused-using-decls]
!Line: 53 - note: remove the usingTestCPP/src/TestCPPTestCase.cpp Lines 55 to 60 in 36a11c0 !Line: 55 - warning: no header providing "std::string" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 56 to 61 in 36a11c0 !Line: 56 - warning: using decl 'tuple' is unused [misc-unused-using-decls]
!Line: 56 - note: remove the usingTestCPP/src/TestCPPTestCase.cpp Lines 63 to 68 in 36a11c0 !Line: 63 - warning: no header providing "atomic_int" is directly included [misc-include-cleaner]
TestCPP/src/TestCPPTestCase.cpp Lines 101 to 106 in 36a11c0 !Line: 101 - warning: rvalue reference parameter 'name' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
TestCPP/src/TestCPPTestCase.cpp Lines 108 to 113 in 36a11c0 !Line: 108 - warning: 'notifyTestPassed' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 109 to 114 in 36a11c0 !Line: 109 - warning: 'test' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 109 to 114 in 36a11c0 !Line: 109 - warning: parameter 'test' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
TestCPP/src/TestCPPTestCase.cpp Lines 111 to 116 in 36a11c0 !Line: 111 - warning: 'testName' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 132 to 137 in 36a11c0 !Line: 132 - warning: parameter name 'o' is too short, expected at least 3 characters [readability-identifier-length]
TestCPP/src/TestCPPTestCase.cpp Lines 136 to 141 in 36a11c0 !Line: 136 - warning: 'pass' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 137 to 142 in 36a11c0 !Line: 137 - warning: 'lastRunTime' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 139 to 144 in 36a11c0 !Line: 139 - warning: 'stdoutCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 140 to 145 in 36a11c0 !Line: 140 - warning: 'clogCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 141 to 146 in 36a11c0 !Line: 141 - warning: 'stderrCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 157 to 162 in 36a11c0 !Line: 157 - warning: an exception may be thrown in function 'TestCase' which should not throw exceptions [bugprone-exception-escape]
TestCPP/src/TestCPPTestCase.cpp Lines 157 to 162 in 36a11c0 !Line: 157 - warning: move constructors should be marked noexcept [cppcoreguidelines-noexcept-move-operations,hicpp-noexcept-move,performance-noexcept-move-constructor]
TestCPP/src/TestCPPTestCase.cpp Lines 157 to 162 in 36a11c0 !Line: 157 - warning: parameter name 'o' is too short, expected at least 3 characters [readability-identifier-length]
TestCPP/src/TestCPPTestCase.cpp Lines 158 to 163 in 36a11c0 !Line: 158 - warning: std::move of the expression of the trivially-copyable type 'TestCaseOutCompareOptions' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 159 to 164 in 36a11c0 !Line: 159 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 161 to 166 in 36a11c0 !Line: 161 - warning: 'pass' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 161 to 166 in 36a11c0 !Line: 161 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 162 to 167 in 36a11c0 !Line: 162 - warning: 'lastRunTime' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 162 to 167 in 36a11c0 !Line: 162 - warning: std::move of the expression of the trivially-copyable type 'long long' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 164 to 169 in 36a11c0 !Line: 164 - warning: 'stdoutCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 164 to 169 in 36a11c0 !Line: 164 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 165 to 170 in 36a11c0 !Line: 165 - warning: 'clogCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 165 to 170 in 36a11c0 !Line: 165 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 166 to 171 in 36a11c0 !Line: 166 - warning: 'stderrCaptured' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
TestCPP/src/TestCPPTestCase.cpp Lines 166 to 171 in 36a11c0 !Line: 166 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 189 to 194 in 36a11c0 !Line: 189 - warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead [cppcoreguidelines-owning-memory]
!Line: 70 - note: variable declared hereTestCPP/src/TestCPPTestCase.cpp Lines 201 to 206 in 36a11c0 !Line: 201 - warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead [cppcoreguidelines-owning-memory]
!Line: 75 - note: variable declared hereTestCPP/src/TestCPPTestCase.cpp Lines 213 to 218 in 36a11c0 !Line: 213 - warning: deleting a pointer through a type that is not marked 'gsl::owner<>'; consider using a smart pointer instead [cppcoreguidelines-owning-memory]
!Line: 80 - note: variable declared hereTestCPP/src/TestCPPTestCase.cpp Lines 221 to 226 in 36a11c0 !Line: 221 - warning: operator=() should take 'TestCase const&', 'TestCase&&' or 'TestCase' [cppcoreguidelines-c-copy-assignment-signature,misc-unconventional-assign-operator]
TestCPP/src/TestCPPTestCase.cpp Lines 221 to 226 in 36a11c0 !Line: 221 - warning: operator=() does not handle self-assignment properly [cert-oop54-cpp]
TestCPP/src/TestCPPTestCase.cpp Lines 221 to 226 in 36a11c0 !Line: 221 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestCase.cpp Lines 248 to 253 in 36a11c0 !Line: 248 - warning: an exception may be thrown in function 'operator=' which should not throw exceptions [bugprone-exception-escape]
TestCPP/src/TestCPPTestCase.cpp Lines 248 to 253 in 36a11c0 !Line: 248 - warning: move assignment operators should be marked noexcept [cppcoreguidelines-noexcept-move-operations,hicpp-noexcept-move,performance-noexcept-move-constructor]
TestCPP/src/TestCPPTestCase.cpp Lines 248 to 253 in 36a11c0 !Line: 248 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestCase.cpp Lines 249 to 254 in 36a11c0 !Line: 249 - warning: std::move of the expression of the trivially-copyable type 'TestCaseOutCompareOptions' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 250 to 255 in 36a11c0 !Line: 250 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 252 to 257 in 36a11c0 !Line: 252 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 253 to 258 in 36a11c0 !Line: 253 - warning: std::move of the expression of the trivially-copyable type 'long long' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 255 to 260 in 36a11c0 !Line: 255 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 256 to 261 in 36a11c0 !Line: 256 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 257 to 262 in 36a11c0 !Line: 257 - warning: std::move of the expression of the trivially-copyable type 'bool' has no effect; remove std::move() [hicpp-move-const-arg,performance-move-const-arg]
TestCPP/src/TestCPPTestCase.cpp Lines 275 to 280 in 36a11c0 !Line: 275 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestCase.cpp Lines 275 to 280 in 36a11c0 !Line: 275 - warning: method 'getLastRuntime' can be made const [readability-make-member-function-const]
TestCPP/src/TestCPPTestCase.cpp Lines 287 to 292 in 36a11c0 !Line: 287 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestCase.cpp Lines 288 to 293 in 36a11c0 !Line: 288 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestCase.cpp Lines 294 to 299 in 36a11c0 !Line: 294 - warning: static member accessed through instance [readability-static-accessed-through-instance]
TestCPP/src/TestCPPTestCase.cpp Lines 296 to 301 in 36a11c0 !Line: 296 - warning: static member accessed through instance [readability-static-accessed-through-instance]
TestCPP/src/TestCPPTestCase.cpp Lines 305 to 310 in 36a11c0 !Line: 305 - warning: static member accessed through instance [readability-static-accessed-through-instance]
TestCPP/src/TestCPPTestCase.cpp Lines 313 to 318 in 36a11c0 !Line: 313 - warning: the value returned by this function should not be disregarded; neglecting it may lead to errors [bugprone-unused-return-value]
TestCPP/src/TestCPPTestCase.cpp Lines 318 to 323 in 36a11c0 !Line: 318 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestCase.cpp Lines 328 to 333 in 36a11c0 !Line: 328 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestCase.cpp Lines 333 to 338 in 36a11c0 !Line: 333 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestCase.cpp Lines 362 to 367 in 36a11c0 !Line: 362 - warning: method 'captureStdout' can be made static [readability-convert-member-functions-to-static]
TestCPP/src/TestCPPTestCase.cpp Lines 382 to 387 in 36a11c0 !Line: 382 - warning: method 'captureClog' can be made static [readability-convert-member-functions-to-static]
TestCPP/src/TestCPPTestCase.cpp Lines 402 to 407 in 36a11c0 !Line: 402 - warning: method 'captureStdErr' can be made static [readability-convert-member-functions-to-static]
TestCPP/src/TestCPPTestCase.cpp Lines 436 to 441 in 36a11c0 !Line: 436 - warning: method 'clearStdoutCapture' can be made static [readability-convert-member-functions-to-static]
TestCPP/src/TestCPPTestCase.cpp Lines 442 to 447 in 36a11c0 !Line: 442 - warning: method 'clearLogCapture' can be made static [readability-convert-member-functions-to-static]
TestCPP/src/TestCPPTestCase.cpp Lines 448 to 453 in 36a11c0 !Line: 448 - warning: method 'clearStderrCapture' can be made static [readability-convert-member-functions-to-static]
TestCPP/src/TestCPPTestCase.cpp Lines 454 to 459 in 36a11c0 !Line: 454 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestCase.cpp Lines 456 to 461 in 36a11c0 !Line: 456 - warning: parameter 'against' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
TestCPP/src/TestCPPTestCase.cpp Lines 459 to 464 in 36a11c0 !Line: 459 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestCase.cpp Lines 461 to 466 in 36a11c0 !Line: 461 - warning: parameter 'against' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
TestCPP/src/TestCPPTestCase.cpp Lines 464 to 469 in 36a11c0 !Line: 464 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestCase.cpp Lines 466 to 471 in 36a11c0 !Line: 466 - warning: parameter 'against' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
TestCPP/src/TestCPPTestCase.cpp Lines 469 to 474 in 36a11c0 !Line: 469 - warning: use a trailing return type for this function [modernize-use-trailing-return-type]
TestCPP/src/TestCPPTestCase.cpp Lines 469 to 474 in 36a11c0 !Line: 469 - warning: the parameter 'source' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
TestCPP/src/TestCPPTestCase.cpp Lines 469 to 474 in 36a11c0 !Line: 469 - warning: the parameter 'against' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
TestCPP/src/TestCPPTestCase.cpp Lines 482 to 487 in 36a11c0 !Line: 482 - warning: static member accessed through instance [readability-static-accessed-through-instance]
TestCPP/src/TestCPPTestCase.cpp Lines 483 to 488 in 36a11c0 !Line: 483 - warning: static member accessed through instance [readability-static-accessed-through-instance]
TestCPP/src/TestCPPTestCase.cpp Lines 484 to 489 in 36a11c0 !Line: 484 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestCase.cpp Lines 488 to 493 in 36a11c0 !Line: 488 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestCase.cpp Lines 504 to 509 in 36a11c0 !Line: 504 - warning: static member accessed through instance [readability-static-accessed-through-instance]
TestCPP/src/TestCPPTestCase.cpp Lines 505 to 510 in 36a11c0 !Line: 505 - warning: static member accessed through instance [readability-static-accessed-through-instance]
TestCPP/src/TestCPPTestCase.cpp Lines 506 to 511 in 36a11c0 !Line: 506 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestCase.cpp Lines 510 to 515 in 36a11c0 !Line: 510 - warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
TestCPP/src/TestCPPTestCase.cpp Lines 517 to 522 in 36a11c0 !Line: 517 - warning: variable name 're' is too short, expected at least 3 characters [readability-identifier-length]
|
|
CPPCheck warnings/violations addressed by this PR via #6 are verified fixed. |
* Mark constructors as explicit to conform to the C++ standard These constructors fall into the guideline of constructors that should be marked explicit. They are converting constructors that are not intended to be used for implicit conversions and copy-initialization. See https://en.cppreference.com/w/cpp/language/explicit From that site: Specifies that a constructor [or conversion function (since C++11)] [or deduction guide (since C++17)] is explicit, that is, it cannot be used for implicit conversions and copy-initialization. See https://en.cppreference.com/w/cpp/language/converting_constructor also. Enable inline CPPCheck suppressions in the GitHub static analysis workflow and the local CPPCheck command in the CodeLite project for suppressing one instance of noExplicitConstructor where it is intended to be used for implicit conversions and copy-initialization. Add inline suppression to TestCPPUtil.h for noExplicitConstructor. Add --std=c++11 parameter argument to local CPPCheck check in project. Removed unnecessary ignores from the CPPCheck command arguments where it just needs a clean prior to running the cppcheck custom target because the build system it generated probably includes more than what should be analyzed by CPPCheck. * Moved this change to main
* Mark constructors as explicit to conform to the C++ standard These constructors fall into the guideline of constructors that should be marked explicit. They are converting constructors that are not intended to be used for implicit conversions and copy-initialization. See https://en.cppreference.com/w/cpp/language/explicit From that site: Specifies that a constructor [or conversion function (since C++11)] [or deduction guide (since C++17)] is explicit, that is, it cannot be used for implicit conversions and copy-initialization. See https://en.cppreference.com/w/cpp/language/converting_constructor also. Enable inline CPPCheck suppressions in the GitHub static analysis workflow and the local CPPCheck command in the CodeLite project for suppressing one instance of noExplicitConstructor where it is intended to be used for implicit conversions and copy-initialization. Add inline suppression to TestCPPUtil.h for noExplicitConstructor. Add --std=c++11 parameter argument to local CPPCheck check in project. Removed unnecessary ignores from the CPPCheck command arguments where it just needs a clean prior to running the cppcheck custom target because the build system it generated probably includes more than what should be analyzed by CPPCheck. * Moved this change to main
* Mark constructors as explicit to conform to the C++ standard These constructors fall into the guideline of constructors that should be marked explicit. They are converting constructors that are not intended to be used for implicit conversions and copy-initialization. See https://en.cppreference.com/w/cpp/language/explicit From that site: Specifies that a constructor [or conversion function (since C++11)] [or deduction guide (since C++17)] is explicit, that is, it cannot be used for implicit conversions and copy-initialization. See https://en.cppreference.com/w/cpp/language/converting_constructor also. Enable inline CPPCheck suppressions in the GitHub static analysis workflow and the local CPPCheck command in the CodeLite project for suppressing one instance of noExplicitConstructor where it is intended to be used for implicit conversions and copy-initialization. Add inline suppression to TestCPPUtil.h for noExplicitConstructor. Add --std=c++11 parameter argument to local CPPCheck check in project. Removed unnecessary ignores from the CPPCheck command arguments where it just needs a clean prior to running the cppcheck custom target because the build system it generated probably includes more than what should be analyzed by CPPCheck. * Moved this change to main
These constructors fall into the guideline of constructors that should be marked explicit.
They are converting constructors that are not intended to be used for implicit conversions and copy-initialization.
See https://en.cppreference.com/w/cpp/language/explicit From that site:
Specifies that a constructor [or conversion function (since C++11)] [or deduction guide (since C++17)] is explicit, that is, it cannot be used for implicit conversions and copy-initialization.
See https://en.cppreference.com/w/cpp/language/converting_constructor also.
Enable inline CPPCheck suppressions in the GitHub static analysis workflow and the local CPPCheck command in the CodeLite project for suppressing one instance of noExplicitConstructor where it is intended to be used for implicit conversions and copy-initialization.
Add inline suppression to TestCPPUtil.h for noExplicitConstructor.
Add --std=c++11 parameter argument to local CPPCheck check in project. Removed unnecessary ignores from the CPPCheck command arguments where it just needs a clean prior to running the cppcheck custom target because the build system it generated probably includes more than what should be analyzed by CPPCheck.