diff --git a/.clang-tidy b/.clang-tidy index e8251bfcc..6968e49a6 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -23,7 +23,6 @@ Checks: > -modernize-loop-convert, -modernize-use-nodiscard, -modernize-use-trailing-return-type, - -readability-function-cognitive-complexity, -readability-identifier-length, -readability-magic-numbers, -readability-named-parameter @@ -79,3 +78,5 @@ CheckOptions: value: lower_case - key: readability-identifier-naming.IgnoreMainLikeFunctions value: 1 + - key: readability-function-cognitive-complexity.Threshold + value: 25 # default: 25 diff --git a/modules/ref/most_different_neighbor_elements/func_tests/ref_tests.cpp b/modules/ref/most_different_neighbor_elements/func_tests/ref_tests.cpp index 25d9c6b4c..41efc6d88 100644 --- a/modules/ref/most_different_neighbor_elements/func_tests/ref_tests.cpp +++ b/modules/ref/most_different_neighbor_elements/func_tests/ref_tests.cpp @@ -138,11 +138,9 @@ TEST(most_different_neighbor_elements, check_int64_t) { for (size_t i = 0; i < in.size(); i++) { if (i % 3 == 0) { in[i] = 10; - } - if (i % 3 == 1) { + } else if (i % 3 == 1) { in[i] = 30; - } - if (i % 3 == 2) { + } else { // (i % 3 == 2) in[i] = 70; } } diff --git a/modules/ref/nearest_neighbor_elements/func_tests/ref_tests.cpp b/modules/ref/nearest_neighbor_elements/func_tests/ref_tests.cpp index 779f4a0d5..698feed09 100644 --- a/modules/ref/nearest_neighbor_elements/func_tests/ref_tests.cpp +++ b/modules/ref/nearest_neighbor_elements/func_tests/ref_tests.cpp @@ -138,11 +138,9 @@ TEST(nearest_neighbor_elements, check_int64_t) { for (size_t i = 0; i < in.size(); i++) { if (i % 3 == 0) { in[i] = 10; - } - if (i % 3 == 1) { + } else if (i % 3 == 1) { in[i] = 30; - } - if (i % 3 == 2) { + } else { // (i % 3 == 2) in[i] = 70; } }