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


##########
be/src/vec/functions/function_cast.h:
##########
@@ -256,9 +256,8 @@ struct ConvertImpl {
 
     template <typename Additions = void*>
     static Status execute(FunctionContext* context, Block& block, const 
ColumnNumbers& arguments,

Review Comment:
   warning: function 'execute' has cognitive complexity of 101 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
       static Status execute(FunctionContext* context, Block& block, const 
ColumnNumbers& arguments,
                     ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_cast.h:268:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || 
IsDataTypeDecimal<ToDataType>) {
           ^
   ```
   **be/src/vec/functions/function_cast.h:268:** +1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || 
IsDataTypeDecimal<ToDataType>) {
                                                         ^
   ```
   **be/src/vec/functions/function_cast.h:269:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || 
IsTimeType<FromDataType> ||
               ^
   ```
   **be/src/vec/functions/function_cast.h:270:** +1
   ```cpp
                               IsTimeV2Type<FromDataType>) ||
                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:276:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
           if (const ColVecFrom* col_from =
           ^
   ```
   **be/src/vec/functions/function_cast.h:282:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:294:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:306:** +1, nesting level increased to 
2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:309:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeNumber<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:313:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || 
IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +1
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || 
IsDataTypeDecimal<ToDataType>) {
                                                             ^
   ```
   **be/src/vec/functions/function_cast.h:324:** +1
   ```cpp
                   bool narrow_integral = context->check_overflow_for_decimal() 
&&
                                                                                
^
   ```
   **be/src/vec/functions/function_cast.h:328:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
                   if (to_scale > from_scale) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:333:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && 
IsDataTypeDecimal<ToDataType>) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:333:** +1
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && 
IsDataTypeDecimal<ToDataType>) {
                                                                 ^
   ```
   **be/src/vec/functions/function_cast.h:337:** +1, nesting level increased to 
3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:358:** +1, nesting level increased to 
2
   ```cpp
               } else if constexpr (IsTimeType<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:359:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:360:** +4, including nesting penalty 
of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeType<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:362:** +5, including nesting penalty 
of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:364:** +1, nesting level increased to 
5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:367:** +1, nesting level increased to 
4
   ```cpp
                       } else if constexpr (IsDateV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:369:** +1, nesting level increased to 
4
   ```cpp
                       } else if constexpr (IsDateTimeV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:371:** +1, nesting level increased to 
4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:376:** +1, nesting level increased to 
2
   ```cpp
               } else if constexpr (IsTimeV2Type<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:377:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:378:** +4, including nesting penalty 
of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeV2Type<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:379:** +5, including nesting penalty 
of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && 
IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:379:** +1
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && 
IsDateV2Type<FromDataType>) {
                                                                      ^
   ```
   **be/src/vec/functions/function_cast.h:381:** +1, nesting level increased to 
5
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> 
&&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:381:** +1
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> 
&&
                                                                               ^
   ```
   **be/src/vec/functions/function_cast.h:384:** +1, nesting level increased to 
5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:388:** +1, nesting level increased to 
4
   ```cpp
                       } else if constexpr (IsTimeType<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:389:** +5, including nesting penalty 
of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && 
IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:389:** +1
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && 
IsDateV2Type<FromDataType>) {
                                                                    ^
   ```
   **be/src/vec/functions/function_cast.h:391:** +1, nesting level increased to 
5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && 
IsDateV2Type<FromDataType>) {
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:391:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && 
IsDateV2Type<FromDataType>) {
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:393:** +1, nesting level increased to 
5
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:393:** +1
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +1, nesting level increased to 
5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:399:** +1, nesting level increased to 
5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:402:** +1, nesting level increased to 
4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:403:** +5, including nesting penalty 
of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:407:** +1, nesting level increased to 
5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:414:** +1, nesting level increased to 
2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:415:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeNumber<FromDataType> &&
                   ^
   ```
   **be/src/vec/functions/function_cast.h:422:** +4, including nesting penalty 
of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:430:** +1, nesting level increased to 
3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:431:** +4, including nesting penalty 
of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:437:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_same_v<uint8_t, ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:438:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
                   for (int i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:444:** +1, nesting level increased to 
1
   ```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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to