github-actions[bot] commented on code in PR #41806:
URL: https://github.com/apache/doris/pull/41806#discussion_r1799107790
##########
be/src/pipeline/exec/exchange_sink_buffer.cpp:
##########
@@ -210,29 +219,29 @@
_instance_to_broadcast_package_queue[ins_id].emplace(request);
}
if (send_now) {
- RETURN_IF_ERROR(_send_rpc(ins_id));
+ RETURN_IF_ERROR(_send_rpc(ins_id, parent));
}
return Status::OK();
}
-Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
+Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id, ExchangeSinkLocalState*
parent) {
Review Comment:
warning: function '_send_rpc' exceeds recommended size/complexity thresholds
[readability-function-size]
```cpp
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id,
ExchangeSinkLocalState* parent) {
^
```
<details>
<summary>Additional context</summary>
**be/src/pipeline/exec/exchange_sink_buffer.cpp:227:** 188 lines including
whitespace and comments (threshold 80)
```cpp
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id,
ExchangeSinkLocalState* parent) {
^
```
</details>
##########
be/src/pipeline/exec/exchange_sink_buffer.cpp:
##########
@@ -210,29 +219,29 @@ Status
ExchangeSinkBuffer::add_block(BroadcastTransmitInfo&& request) {
_instance_to_broadcast_package_queue[ins_id].emplace(request);
}
if (send_now) {
- RETURN_IF_ERROR(_send_rpc(ins_id));
+ RETURN_IF_ERROR(_send_rpc(ins_id, parent));
}
return Status::OK();
}
-Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
+Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id, ExchangeSinkLocalState*
parent) {
Review Comment:
warning: function '_send_rpc' has cognitive complexity of 74 (threshold 50)
[readability-function-cognitive-complexity]
```cpp
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id,
ExchangeSinkLocalState* parent) {
^
```
<details>
<summary>Additional context</summary>
**be/src/pipeline/exec/exchange_sink_buffer.cpp:236:** +1, including nesting
penalty of 0, nesting level increased to 1
```cpp
if (_is_finishing) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:241:** +1, including nesting
penalty of 0, nesting level increased to 1
```cpp
if (!instance_q.empty()) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:247:** +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:247:** +1
```cpp
if (request.block && !request.block->column_metas().empty()) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:250:** +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([&, weak_task_ctx =
weak_task_exec_ctx(), parent](
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:265:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (task_lock == nullptr) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:274:** nesting level
increased to 2
```cpp
send_callback->addSuccessHandler([&, weak_task_ctx =
weak_task_exec_ctx(), parent](
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:279:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (task_lock == nullptr) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:287:** +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:289:** +1, nesting level
increased to 3
```cpp
} else if (!s.ok()) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:293:** +1, nesting level
increased to 3
```cpp
} else if (eos) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:295:** +1, nesting level
increased to 3
```cpp
} else {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:297:** +4, including nesting
penalty of 3, nesting level increased to 4
```cpp
if (!s) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:310:** +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:311:** +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:311:** +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:314:** +1, nesting level
increased to 2
```cpp
} else {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:319:** +2, including nesting
penalty of 1, nesting level increased to 2
```cpp
if (request.block) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:325:** +2, including nesting
penalty of 1, nesting level increased to 2
```cpp
if (parent->_queue_dependency && _total_queue_size <=
_queue_capacity) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:328:** +1, nesting level
increased to 1
```cpp
} else if (!broadcast_q.empty()) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:334:** +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:334:** +1
```cpp
if (request.block_holder->get_block() &&
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:346:** +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:349:** nesting level
increased to 2
```cpp
send_callback->addFailedHandler([&, weak_task_ctx =
weak_task_exec_ctx(), parent](
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:352:** +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:** nesting level
increased to 2
```cpp
send_callback->addSuccessHandler([&, weak_task_ctx =
weak_task_exec_ctx(), parent](
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:366:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (task_lock == nullptr) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:374:** +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:376:** +1, nesting level
increased to 3
```cpp
} else if (!s.ok()) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:380:** +1, nesting level
increased to 3
```cpp
} else if (eos) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:382:** +1, nesting level
increased to 3
```cpp
} else {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:384:** +4, including nesting
penalty of 3, nesting level increased to 4
```cpp
if (!s) {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:397:** +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:398:** +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:398:** +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:401:** +1, nesting level
increased to 2
```cpp
} else {
^
```
**be/src/pipeline/exec/exchange_sink_buffer.cpp:406:** +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:410:** +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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]