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


##########
be/src/pipeline/exec/exchange_sink_buffer.cpp:
##########
@@ -211,8 +214,6 @@ Status 
ExchangeSinkBuffer::add_block(BroadcastTransmitInfo&& request) {
 Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {

Review Comment:
   warning: function '_send_rpc' has cognitive complexity of 70 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
   Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
                              ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:220:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (_is_finishing) {
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:225:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (!q.empty()) {
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:233:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (request.block && !request.block->column_metas().empty()) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:233:** +1
   ```cpp
           if (request.block && !request.block->column_metas().empty()) {
                             ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:236:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (!request.exec_status.ok()) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:242:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (config::execution_ignore_eovercrowded) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:245:** nesting level 
increased to 2
   ```cpp
           send_callback->addFailedHandler([&, weak_task_ctx = 
weak_task_exec_ctx()](
                                           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:248:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (task_lock == nullptr) {
               ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:257:** nesting level 
increased to 2
   ```cpp
           send_callback->addSuccessHandler([&, weak_task_ctx = 
weak_task_exec_ctx()](
                                            ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:262:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (task_lock == nullptr) {
               ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:273:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (s.is<ErrorCode::END_OF_FILE>()) {
               ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:275:** +1, nesting level 
increased to 3
   ```cpp
               } else if (!s.ok()) {
                      ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:279:** +1, nesting level 
increased to 3
   ```cpp
               } else if (eos) {
                      ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:284:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
                   if (!s) {
                   ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:295:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
               if (enable_http_send_block(*brpc_request)) {
               ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:296:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
                   RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                   ^
   ```
   **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:296:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                   ^
   ```
   **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:299:** +1, nesting level 
increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:304:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (request.block) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:311:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (_total_queue_size <= _queue_capacity) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:316:** +1, nesting level 
increased to 1
   ```cpp
       } else if (!broadcast_q.empty()) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:324:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (request.block_holder->get_block() &&
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:324:** +1
   ```cpp
           if (request.block_holder->get_block() &&
                                                 ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:330:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (config::execution_ignore_eovercrowded) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:333:** nesting level 
increased to 2
   ```cpp
           send_callback->addFailedHandler([&, weak_task_ctx = 
weak_task_exec_ctx()](
                                           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:336:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (task_lock == nullptr) {
               ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:345:** nesting level 
increased to 2
   ```cpp
           send_callback->addSuccessHandler([&, weak_task_ctx = 
weak_task_exec_ctx()](
                                            ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:350:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (task_lock == nullptr) {
               ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:361:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (s.is<ErrorCode::END_OF_FILE>()) {
               ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:363:** +1, nesting level 
increased to 3
   ```cpp
               } else if (!s.ok()) {
                      ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:367:** +1, nesting level 
increased to 3
   ```cpp
               } else if (eos) {
                      ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:372:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
                   if (!s) {
                   ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:383:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
               if (enable_http_send_block(*brpc_request)) {
               ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:384:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
                   RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                   ^
   ```
   **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:384:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                   ^
   ```
   **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:387:** +1, nesting level 
increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:392:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (request.block_holder->get_block()) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:396:** +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