github-actions[bot] commented on code in PR #28456:
URL: https://github.com/apache/doris/pull/28456#discussion_r1427556796


##########
be/src/vec/functions/function_binary_arithmetic.h:
##########
@@ -516,11 +490,18 @@ struct DecimalBinaryOperation {
     static ALWAYS_INLINE NativeResultType apply(NativeResultType a, 
NativeResultType b,

Review Comment:
   warning: function 'apply' has cognitive complexity of 68 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
       static ALWAYS_INLINE NativeResultType apply(NativeResultType a, 
NativeResultType b,
                                             ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_binary_arithmetic.h:493:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (IsDecimalV2<B> || IsDecimalV2<A>) {
           ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:493:** +1
   ```cpp
           if constexpr (IsDecimalV2<B> || IsDecimalV2<A>) {
                                        ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:495:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (check_overflow) {
               ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:497:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if (res > max_result_number.value || res < 
-max_result_number.value) {
                   ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:497:** +1
   ```cpp
                   if (res > max_result_number.value || res < 
-max_result_number.value) {
                                                     ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:501:** +1, nesting level 
increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:504:** +1, nesting level 
increased to 1
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:506:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (OpTraits::can_overflow && check_overflow) {
               ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:508:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if (UNLIKELY(Op::template apply<NativeResultType>(a, b, 
res))) {
                   ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:509:** +4, including 
nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (OpTraits::is_plus_minus) {
                       ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:514:** +4, including 
nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (std::is_same_v<NativeResultType, 
__int128>) {
                       ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:516:** +5, including 
nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (OpTraits::is_multiply && 
need_adjust_scale) {
                           ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:517:** +6, including 
nesting penalty of 5, nesting level increased to 6
   ```cpp
                               if (res256 > 0) {
                               ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:521:** +1, nesting level 
increased to 6
   ```cpp
                               } else {
                                 ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:527:** +5, including 
nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if (res256 > wide::Int256(max_result_number.value) ||
                           ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:527:** +1
   ```cpp
                           if (res256 > wide::Int256(max_result_number.value) ||
                                                                              ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:531:** +1, nesting level 
increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:534:** +1, nesting level 
increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:538:** +1, nesting level 
increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:540:** +4, including 
nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (OpTraits::is_multiply && 
need_adjust_scale) {
                       ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:541:** +5, including 
nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if (res >= 0) {
                           ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:544:** +1, nesting level 
increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:549:** +4, including 
nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if (res > max_result_number.value || res < 
-max_result_number.value) {
                       ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:549:** +1
   ```cpp
                       if (res > max_result_number.value || res < 
-max_result_number.value) {
                                                         ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:555:** +1, nesting level 
increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:557:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (OpTraits::is_multiply && need_adjust_scale) {
                   ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:558:** +4, including 
nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if (res >= 0) {
                       ^
   ```
   **be/src/vec/functions/function_binary_arithmetic.h:560:** +1, nesting level 
increased to 4
   ```cpp
                       } else {
                         ^
   ```
   
   </details>
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to