github-actions[bot] commented on code in PR #28361: URL: https://github.com/apache/doris/pull/28361#discussion_r1442573589
########## be/src/vec/functions/function_ip.h: ########## @@ -348,4 +348,261 @@ } }; +namespace detail { +template <IPStringToNumExceptionMode exception_mode, typename ToColumn = ColumnIPv6, + typename StringColumnType> +ColumnPtr convertToIPv6(const StringColumnType& string_column, Review Comment: warning: function 'convertToIPv6' exceeds recommended size/complexity thresholds [readability-function-size] ```cpp ColumnPtr convertToIPv6(const StringColumnType& string_column, ^ ``` <details> <summary>Additional context</summary> **be/src/vec/functions/function_ip.h:353:** 174 lines including whitespace and comments (threshold 80) ```cpp ColumnPtr convertToIPv6(const StringColumnType& string_column, ^ ``` </details> ########## be/src/vec/functions/function_ip.h: ########## @@ -348,4 +348,261 @@ class FunctionIPv6NumToString : public IFunction { } }; +namespace detail { +template <IPStringToNumExceptionMode exception_mode, typename ToColumn = ColumnIPv6, + typename StringColumnType> +ColumnPtr convertToIPv6(const StringColumnType& string_column, Review Comment: warning: function 'convertToIPv6' has cognitive complexity of 73 (threshold 50) [readability-function-cognitive-complexity] ```cpp ColumnPtr convertToIPv6(const StringColumnType& string_column, ^ ``` <details> <summary>Additional context</summary> **be/src/vec/functions/function_ip.h:355:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if constexpr (!std::is_same_v<ToColumn, ColumnString> && ^ ``` **be/src/vec/functions/function_ip.h:367:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if constexpr (exception_mode == IPStringToNumExceptionMode::Null) { ^ ``` **be/src/vec/functions/function_ip.h:374:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if constexpr (std::is_same_v<StringColumnType, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:375:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (string_column.get_offsets()[0] - 1 == IPV6_BINARY_LENGTH) { ^ ``` **be/src/vec/functions/function_ip.h:376:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if constexpr (std::is_same_v<ToColumn, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:379:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if constexpr (exception_mode == IPStringToNumExceptionMode::Null) { ^ ``` **be/src/vec/functions/function_ip.h:381:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp if (null_map) { ^ ``` **be/src/vec/functions/function_ip.h:389:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/vec/functions/function_ip.h:397:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if constexpr (exception_mode == IPStringToNumExceptionMode::Null) { ^ ``` **be/src/vec/functions/function_ip.h:399:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp if (null_map) { ^ ``` **be/src/vec/functions/function_ip.h:410:** nesting level increased to 1 ```cpp auto column_create = [](size_t column_size) -> typename ToColumn::MutablePtr { ^ ``` **be/src/vec/functions/function_ip.h:411:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if constexpr (std::is_same_v<ToColumn, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:416:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/vec/functions/function_ip.h:421:** nesting level increased to 1 ```cpp auto get_vector = [](auto& col_res, size_t col_size) -> decltype(auto) { ^ ``` **be/src/vec/functions/function_ip.h:422:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if constexpr (std::is_same_v<ToColumn, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:426:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/vec/functions/function_ip.h:447:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if constexpr (std::is_same_v<ToColumn, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:451:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp for (size_t out_offset = 0, i = 0; i < column_size; out_offset += offset_inc, ++i) { ^ ``` **be/src/vec/functions/function_ip.h:457:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if constexpr (std::is_same_v<StringColumnType, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:465:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (null_map && (*null_map)[i]) { ^ ``` **be/src/vec/functions/function_ip.h:465:** +1 ```cpp if (null_map && (*null_map)[i]) { ^ ``` **be/src/vec/functions/function_ip.h:466:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (exception_mode == IPStringToNumExceptionMode::Throw) { ^ ``` **be/src/vec/functions/function_ip.h:468:** +1, nesting level increased to 3 ```cpp } else if (exception_mode == IPStringToNumExceptionMode::Default) { ^ ``` **be/src/vec/functions/function_ip.h:470:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/vec/functions/function_ip.h:473:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if constexpr (std::is_same_v<ToColumn, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:490:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (string_length != 0) { ^ ``` **be/src/vec/functions/function_ip.h:491:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (tryParseIPv4(src_value, dummy_result)) { ^ ``` **be/src/vec/functions/function_ip.h:494:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/vec/functions/function_ip.h:499:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (parse_result && string_length != 0) { ^ ``` **be/src/vec/functions/function_ip.h:499:** +1 ```cpp if (parse_result && string_length != 0) { ^ ``` **be/src/vec/functions/function_ip.h:500:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if constexpr (std::is_same_v<ToColumn, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:505:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/vec/functions/function_ip.h:508:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/vec/functions/function_ip.h:509:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (exception_mode == IPStringToNumExceptionMode::Throw) { ^ ``` **be/src/vec/functions/function_ip.h:513:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if constexpr (std::is_same_v<ToColumn, ColumnString>) { ^ ``` **be/src/vec/functions/function_ip.h:517:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if constexpr (exception_mode == IPStringToNumExceptionMode::Null) { ^ ``` **be/src/vec/functions/function_ip.h:524:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if constexpr (exception_mode == IPStringToNumExceptionMode::Null) { ^ ``` </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