github-actions[bot] commented on code in PR #28361:
URL: https://github.com/apache/doris/pull/28361#discussion_r1425307232
##########
be/src/vec/functions/function_ip.h:
##########
@@ -348,4 +348,254 @@
}
};
+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:** 170 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,254 @@ 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 71 (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:468:** +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:470:** +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:486:** +2, including nesting penalty of
1, nesting level increased to 2
```cpp
if (string_length != 0) {
^
```
**be/src/vec/functions/function_ip.h:487:** +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:490:** +1, nesting level increased to 3
```cpp
} else {
^
```
**be/src/vec/functions/function_ip.h:495:** +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:495:** +1
```cpp
if (parse_result && string_length != 0) {
^
```
**be/src/vec/functions/function_ip.h:496:** +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:501:** +1, nesting level increased to 3
```cpp
} else {
^
```
**be/src/vec/functions/function_ip.h:504:** +1, nesting level increased to 2
```cpp
} else {
^
```
**be/src/vec/functions/function_ip.h:505:** +3, including nesting penalty of
2, nesting level increased to 3
```cpp
if (exception_mode == IPStringToNumExceptionMode::Throw) {
^
```
**be/src/vec/functions/function_ip.h:509:** +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:513:** +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:520:** +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: [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]