github-actions[bot] commented on code in PR #34408: URL: https://github.com/apache/doris/pull/34408#discussion_r1590498558
########## be/src/pipeline/exec/exchange_sink_buffer.cpp: ########## @@ -239,20 +223,17 @@ return Status::OK(); } -template <typename Parent> -Status ExchangeSinkBuffer<Parent>::_send_rpc(InstanceLoId id) { +Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) { Review Comment: warning: function '_send_rpc' exceeds recommended size/complexity thresholds [readability-function-size] ```cpp Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) { ^ ``` <details> <summary>Additional context</summary> **be/src/pipeline/exec/exchange_sink_buffer.cpp:225:** 172 lines including whitespace and comments (threshold 80) ```cpp Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) { ^ ``` </details> ########## be/src/pipeline/exec/exchange_sink_buffer.cpp: ########## @@ -239,20 +223,17 @@ Status ExchangeSinkBuffer<Parent>::add_block(BroadcastTransmitInfo<Parent>&& req return Status::OK(); } -template <typename Parent> -Status ExchangeSinkBuffer<Parent>::_send_rpc(InstanceLoId id) { +Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) { Review Comment: warning: function '_send_rpc' has cognitive complexity of 64 (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:234:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (_is_finishing) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:239:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (!q.empty()) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:245:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (request.block) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:248:** +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:257:** +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:260:** nesting level increased to 2 ```cpp send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()]( ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:263:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (task_lock == nullptr) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:272:** nesting level increased to 2 ```cpp send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()]( ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:277:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (task_lock == nullptr) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:285:** +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:287:** +1, nesting level increased to 3 ```cpp } else if (!s.ok()) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:290:** +1, nesting level increased to 3 ```cpp } else if (eos) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:292:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:301:** +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:302:** +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:541:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:302:** +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:543:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:305:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:310:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (request.block) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:315:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (_queue_dependency && _total_queue_size <= _queue_capacity) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:318:** +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:335:** +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:338:** nesting level increased to 2 ```cpp send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()]( ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:341:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (task_lock == nullptr) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:350:** nesting level increased to 2 ```cpp send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()]( ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:355:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (task_lock == nullptr) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:363:** +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:365:** +1, nesting level increased to 3 ```cpp } else if (!s.ok()) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:368:** +1, nesting level increased to 3 ```cpp } else if (eos) { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:370:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:379:** +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:380:** +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:541:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:380:** +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:543:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:383:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/pipeline/exec/exchange_sink_buffer.cpp:388:** +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:392:** +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