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


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

Review Comment:
   warning: function '_send_rpc' has cognitive complexity of 60 (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:227:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (_is_finishing) {
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:234:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (!q.empty()) {
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:249:** +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:249:** +1
   ```cpp
           if (request.block && !request.block->column_metas().empty()) {
                             ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:252:** +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:259:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (config::exchange_sink_ignore_eovercrowded) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:262:** nesting level 
increased to 2
   ```cpp
           send_callback->addFailedHandler([&](const InstanceLoId& id, const 
std::string& err) {
                                           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:267:** nesting level 
increased to 2
   ```cpp
           send_callback->addSuccessHandler([&](const InstanceLoId& id, const 
bool& eos,
                                            ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:274:** +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:276:** +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 {
                 ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:281:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!s) {
                   ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:292:** +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:293:** +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:629:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:293:** +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:631:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:296:** +1, nesting level 
increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:301:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (request.block) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:306:** +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:313:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (!broadcast_q.empty()) {
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:328:** +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:328:** +1
   ```cpp
           if (request.block_holder->get_block() &&
                                                 ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:336:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (config::exchange_sink_ignore_eovercrowded) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:339:** nesting level 
increased to 2
   ```cpp
           send_callback->addFailedHandler([&](const InstanceLoId& id, const 
std::string& err) {
                                           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:344:** nesting level 
increased to 2
   ```cpp
           send_callback->addSuccessHandler([&](const InstanceLoId& id, const 
bool& eos,
                                            ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:351:** +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:353:** +1, nesting level 
increased to 3
   ```cpp
               } else if (!s.ok()) {
                      ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:356:** +1, nesting level 
increased to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:358:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!s) {
                   ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:369:** +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:370:** +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:629:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:370:** +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:631:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:373:** +1, nesting level 
increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/pipeline/exec/exchange_sink_buffer.cpp:378:** +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:383:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (is_empty) {
       ^
   ```
   
   </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