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


##########
be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:
##########
@@ -542,66 +515,79 @@ class InvertedIndexColumnWriterImpl : public 
InvertedIndexColumnWriter {
     }
 
     Status finish() override {

Review Comment:
   warning: function 'finish' has cognitive complexity of 52 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
       Status finish() override {
              ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:517:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if (_dir != nullptr) {
           ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:524:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
                   if constexpr (field_is_numeric_type(field_type)) {
                   ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:541:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
                       
DBUG_EXECUTE_IF("InvertedIndexWriter._set_bkd_data_out_nullptr",
                       ^
   ```
   **be/src/util/debug_points.h:34:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
       if (UNLIKELY(config::enable_debug_points)) {                             
 \
       ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:541:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       
DBUG_EXECUTE_IF("InvertedIndexWriter._set_bkd_data_out_nullptr",
                       ^
   ```
   **be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
           if (dp) {                                                            
 \
           ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:543:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
                       if (data_out != nullptr && meta_out != nullptr && 
index_out != nullptr) {
                       ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:548:** +1, nesting 
level increased to 3
   ```cpp
                       } else {
                         ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:557:** +1, nesting 
level increased to 2
   ```cpp
                   } else if constexpr (field_is_slice_type(field_type)) {
                          ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:564:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
                       DBUG_EXECUTE_IF(
                       ^
   ```
   **be/src/util/debug_points.h:34:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
       if (UNLIKELY(config::enable_debug_points)) {                             
 \
       ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:564:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       DBUG_EXECUTE_IF(
                       ^
   ```
   **be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
           if (dp) {                                                            
 \
           ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:570:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
               } catch (CLuceneError& e) {
                 ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:571:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   FINALLY_CLOSE_OUTPUT(null_bitmap_out)
                   ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:62:** expanded 
from macro 'FINALLY_CLOSE_OUTPUT'
   ```cpp
       } catch (...) {                   \
         ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:572:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   FINALLY_CLOSE_OUTPUT(meta_out)
                   ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:62:** expanded 
from macro 'FINALLY_CLOSE_OUTPUT'
   ```cpp
       } catch (...) {                   \
         ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:573:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   FINALLY_CLOSE_OUTPUT(data_out)
                   ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:62:** expanded 
from macro 'FINALLY_CLOSE_OUTPUT'
   ```cpp
       } catch (...) {                   \
         ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:574:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   FINALLY_CLOSE_OUTPUT(index_out)
                   ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:62:** expanded 
from macro 'FINALLY_CLOSE_OUTPUT'
   ```cpp
       } catch (...) {                   \
         ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:575:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (field_is_numeric_type(field_type)) {
                   ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:576:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       FINALLY_CLOSE_OUTPUT(_dir)
                       ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:61:** expanded 
from macro 'FINALLY_CLOSE_OUTPUT'
   ```cpp
           if (x != nullptr) x->close(); \
           ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:576:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       FINALLY_CLOSE_OUTPUT(_dir)
                       ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:62:** expanded 
from macro 'FINALLY_CLOSE_OUTPUT'
   ```cpp
       } catch (...) {                   \
         ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:577:** +1, nesting 
level increased to 3
   ```cpp
                   } else if constexpr (field_is_slice_type(field_type)) {
                          ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:578:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       FINALLY_CLOSE_OUTPUT(_index_writer);
                       ^
   ```
   **be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:62:** expanded 
from macro 'FINALLY_CLOSE_OUTPUT'
   ```cpp
       } catch (...) {                   \
         ^
   ```
   
   </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