github-actions[bot] commented on code in PR #45400:
URL: https://github.com/apache/doris/pull/45400#discussion_r1887992943
##########
be/src/pipeline/pipeline_x/pipeline_x_task.cpp:
##########
@@ -226,6 +226,10 @@ Status PipelineXTask::_open() {
}
Status PipelineXTask::execute(bool* eos) {
Review Comment:
warning: function 'execute' has cognitive complexity of 76 (threshold 50)
[readability-function-cognitive-complexity]
```cpp
Status PipelineXTask::execute(bool* eos) {
^
```
<details>
<summary>Additional context</summary>
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:228:** +1, including
nesting penalty of 0, nesting level increased to 1
```cpp
if (_eos) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:236:** +1, including
nesting penalty of 0, nesting level increased to 1
```cpp
DBUG_EXECUTE_IF("fault_inject::PipelineXTask::execute", {
^
```
**be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
```cpp
if (UNLIKELY(config::enable_debug_points)) {
\
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:236:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
DBUG_EXECUTE_IF("fault_inject::PipelineXTask::execute", {
^
```
**be/src/util/debug_points.h:38:** expanded from macro 'DBUG_EXECUTE_IF'
```cpp
if (dp) {
\
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:254:** +1, including
nesting penalty of 0, nesting level increased to 1
```cpp
if (has_dependency()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:258:** +1, including
nesting penalty of 0, nesting level increased to 1
```cpp
if (_runtime_filter_blocked_dependency() != nullptr) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:264:** +1, including
nesting penalty of 0, nesting level increased to 1
```cpp
if (!_opened) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:265:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (_wake_up_early) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:272:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
RETURN_IF_ERROR(_open());
^
```
**be/src/common/status.h:622:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:272:** +3, including
nesting penalty of 2, nesting level increased to 3
```cpp
RETURN_IF_ERROR(_open());
^
```
**be/src/common/status.h:624:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:274:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (!source_can_read()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:278:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (!sink_can_write()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:284:** nesting level
increased to 1
```cpp
auto set_wake_up_and_dep_ready = [&]() {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:285:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (wake_up_early()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:294:** +1, including
nesting penalty of 0, nesting level increased to 1
```cpp
while (!_fragment_context->is_canceled()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:295:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (_root->need_data_from_children(_state) && !source_can_read()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:299:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (!sink_can_write()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:307:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (_fragment_context->is_canceled()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:311:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (time_spent > THREAD_TIME_SLICE) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:320:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (should_revoke_memory(_state, sink_revocable_mem_size)) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:321:** +3, including
nesting penalty of 2, nesting level increased to 3
```cpp
RETURN_IF_ERROR(_sink->revoke_memory(_state));
^
```
**be/src/common/status.h:622:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:321:** +4, including
nesting penalty of 3, nesting level increased to 4
```cpp
RETURN_IF_ERROR(_sink->revoke_memory(_state));
^
```
**be/src/common/status.h:624:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:324:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
DBUG_EXECUTE_IF("fault_inject::PipelineXTask::executing", {
^
```
**be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
```cpp
if (UNLIKELY(config::enable_debug_points)) {
\
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:324:** +3, including
nesting penalty of 2, nesting level increased to 3
```cpp
DBUG_EXECUTE_IF("fault_inject::PipelineXTask::executing", {
^
```
**be/src/util/debug_points.h:38:** expanded from macro 'DBUG_EXECUTE_IF'
```cpp
if (dp) {
\
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:330:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (_sink->is_finished(_state)) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:334:** +1
```cpp
*eos = wake_up_early() || _dry_run;
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:337:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (!*eos) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:341:** +3, including
nesting penalty of 2, nesting level increased to 3
```cpp
RETURN_IF_ERROR(_root->get_block_after_projects(_state,
block, eos));
^
```
**be/src/common/status.h:622:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:341:** +4, including
nesting penalty of 3, nesting level increased to 4
```cpp
RETURN_IF_ERROR(_root->get_block_after_projects(_state,
block, eos));
^
```
**be/src/common/status.h:624:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:342:** +3, including
nesting penalty of 2, nesting level increased to 3
```cpp
} catch (const Exception& e) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:348:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (*eos) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:349:** +3, including
nesting penalty of 2, nesting level increased to 3
```cpp
RETURN_IF_ERROR(close(Status::OK(), false));
^
```
**be/src/common/status.h:622:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:349:** +4, including
nesting penalty of 3, nesting level increased to 4
```cpp
RETURN_IF_ERROR(close(Status::OK(), false));
^
```
**be/src/common/status.h:624:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:352:** +2, including
nesting penalty of 1, nesting level increased to 2
```cpp
if (_block->rows() != 0 || *eos) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:355:** +3, including
nesting penalty of 2, nesting level increased to 3
```cpp
if (status.is<ErrorCode::END_OF_FILE>()) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:357:** +1, nesting level
increased to 3
```cpp
} else if (!status) {
^
```
**be/src/pipeline/pipeline_x/pipeline_x_task.cpp:361:** +3, including
nesting penalty of 2, nesting level increased to 3
```cpp
if (*eos) { // just return, the scheduler will do finish work
^
```
</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]