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


##########
be/src/exec/olap_common.h:
##########
@@ -968,7 +966,7 @@ bool ColumnValueRange<primitive_type>::is_in_range(const 
CppType& value) {
 }
 
 template <PrimitiveType primitive_type>
-void 
ColumnValueRange<primitive_type>::intersection(ColumnValueRange<primitive_type>&
 range) {
+Status 
ColumnValueRange<primitive_type>::intersection(ColumnValueRange<primitive_type>&
 range) {
     // 1. clear if column type not match

Review Comment:
   warning: function 'intersection' has cognitive complexity of 56 (threshold 
50) [readability-function-cognitive-complexity]
   ```cpp
   Status 
ColumnValueRange<primitive_type>::intersection(ColumnValueRange<primitive_type>&
 range) {
                                            ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/exec/olap_common.h:971:** +1, including nesting penalty of 0, 
nesting level increased to 1
   ```cpp
       if (_column_type != range._column_type) {
       ^
   ```
   **be/src/exec/olap_common.h:976:** +1, including nesting penalty of 0, 
nesting level increased to 1
   ```cpp
       if (is_empty_value_range() || range.is_empty_value_range()) {
       ^
   ```
   **be/src/exec/olap_common.h:976:** +1
   ```cpp
       if (is_empty_value_range() || range.is_empty_value_range()) {
                                  ^
   ```
   **be/src/exec/olap_common.h:982:** +1, including nesting penalty of 0, 
nesting level increased to 1
   ```cpp
       if (is_fixed_value_range() || range.is_fixed_value_range() || 
range.is_match_value_range()) {
       ^
   ```
   **be/src/exec/olap_common.h:982:** +1
   ```cpp
       if (is_fixed_value_range() || range.is_fixed_value_range() || 
range.is_match_value_range()) {
                                                                  ^
   ```
   **be/src/exec/olap_common.h:983:** +2, including nesting penalty of 1, 
nesting level increased to 2
   ```cpp
           if (is_fixed_value_range() && range.is_fixed_value_range()) {
           ^
   ```
   **be/src/exec/olap_common.h:983:** +1
   ```cpp
           if (is_fixed_value_range() && range.is_fixed_value_range()) {
                                      ^
   ```
   **be/src/exec/olap_common.h:987:** +1, nesting level increased to 2
   ```cpp
           } else if (is_fixed_value_range() && !range.is_fixed_value_range()) {
                  ^
   ```
   **be/src/exec/olap_common.h:987:** +1
   ```cpp
           } else if (is_fixed_value_range() && !range.is_fixed_value_range()) {
                                             ^
   ```
   **be/src/exec/olap_common.h:990:** +3, including nesting penalty of 2, 
nesting level increased to 3
   ```cpp
               while (iter != _fixed_values.end()) {
               ^
   ```
   **be/src/exec/olap_common.h:991:** +4, including nesting penalty of 3, 
nesting level increased to 4
   ```cpp
                   if (range.is_in_range(*iter)) {
                   ^
   ```
   **be/src/exec/olap_common.h:996:** +1, nesting level increased to 2
   ```cpp
           } else if (!is_fixed_value_range() && range.is_fixed_value_range()) {
                  ^
   ```
   **be/src/exec/olap_common.h:996:** +1
   ```cpp
           } else if (!is_fixed_value_range() && range.is_fixed_value_range()) {
                                              ^
   ```
   **be/src/exec/olap_common.h:998:** +3, including nesting penalty of 2, 
nesting level increased to 3
   ```cpp
               while (iter != range._fixed_values.end()) {
               ^
   ```
   **be/src/exec/olap_common.h:999:** +4, including nesting penalty of 3, 
nesting level increased to 4
   ```cpp
                   if (this->is_in_range(*iter)) {
                   ^
   ```
   **be/src/exec/olap_common.h:1006:** +2, including nesting penalty of 1, 
nesting level increased to 2
   ```cpp
           if (!result_values.empty()) {
           ^
   ```
   **be/src/exec/olap_common.h:1011:** +1, nesting level increased to 2
   ```cpp
           } else if (range.is_match_value_range()) {
                  ^
   ```
   **be/src/exec/olap_common.h:1012:** +3, including nesting penalty of 2, 
nesting level increased to 3
   ```cpp
               for (auto& value : range._match_values) {
               ^
   ```
   **be/src/exec/olap_common.h:1015:** +1, nesting level increased to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/exec/olap_common.h:1018:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/exec/olap_common.h:1019:** +2, including nesting penalty of 1, 
nesting level increased to 2
   ```cpp
           if (contain_null() && range.contain_null()) {
           ^
   ```
   **be/src/exec/olap_common.h:1019:** +1
   ```cpp
           if (contain_null() && range.contain_null()) {
                              ^
   ```
   **be/src/exec/olap_common.h:1021:** +3, including nesting penalty of 2, 
nesting level increased to 3
   ```cpp
               if (!is_whole_value_range() || !range.is_whole_value_range()) {
               ^
   ```
   **be/src/exec/olap_common.h:1021:** +1
   ```cpp
               if (!is_whole_value_range() || !range.is_whole_value_range()) {
                                           ^
   ```
   **be/src/exec/olap_common.h:1024:** +1, nesting level increased to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/exec/olap_common.h:1025:** +3, including nesting penalty of 2, 
nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(add_range(range._high_op, range._high_value));
               ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/exec/olap_common.h:1025:** +4, including nesting penalty of 3, 
nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(add_range(range._high_op, range._high_value));
               ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/exec/olap_common.h:1026:** +3, including nesting penalty of 2, 
nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(add_range(range._low_op, range._low_value));
               ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/exec/olap_common.h:1026:** +4, including nesting penalty of 3, 
nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(add_range(range._low_op, range._low_value));
               ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   
   </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