github-actions[bot] commented on code in PR #42333: URL: https://github.com/apache/doris/pull/42333#discussion_r1816202898
########## be/src/pipeline/exec/exchange_sink_operator.cpp: ########## @@ -676,7 +676,7 @@ Status ExchangeSinkOperatorX::channel_add_rows( Status ExchangeSinkOperatorX::channel_add_rows_with_idx( RuntimeState* state, std::vector<std::shared_ptr<vectorized::Channel>>& channels, - int num_channels, std::vector<std::vector<uint32_t>>& channel2rows, + size_t num_channels, std::vector<std::vector<uint32_t>>& channel2rows, Review Comment: warning: function 'channel_add_rows_with_idx' has cognitive complexity of 52 (threshold 50) [readability-function-cognitive-complexity] ```cpp Status ExchangeSinkOperatorX::channel_add_rows_with_idx( ^ ``` <details> <summary>Additional context</summary> **be/src/pipeline/exec/exchange_sink_operator.cpp:682:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp for (int i = 0; i < num_channels; ++i) { ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:683:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (!channels[i]->is_receiver_eof() && !channel2rows[i].empty()) { ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:683:** +1 ```cpp if (!channels[i]->is_receiver_eof() && !channel2rows[i].empty()) { ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:685:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:224:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp do { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:685:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:225:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp if (status.is<ErrorCode::END_OF_FILE>()) { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:685:** +1, nesting level increased to 4 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:227:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp } else { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:685:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:228:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp RETURN_IF_ERROR(status); \ ^ ``` **be/src/common/status.h:629:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:685:** +6, including nesting penalty of 5, nesting level increased to 6 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:228:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp RETURN_IF_ERROR(status); \ ^ ``` **be/src/common/status.h:631:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:689:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (eos) { ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:690:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp for (int i = 0; i < num_channels; ++i) { ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:691:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (!channels[i]->is_receiver_eof()) { ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:693:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:224:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp do { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:693:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:225:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp if (status.is<ErrorCode::END_OF_FILE>()) { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:693:** +1, nesting level increased to 5 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:227:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp } else { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:693:** +6, including nesting penalty of 5, nesting level increased to 6 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:228:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp RETURN_IF_ERROR(status); \ ^ ``` **be/src/common/status.h:629:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/exchange_sink_operator.cpp:693:** +7, including nesting penalty of 6, nesting level increased to 7 ```cpp HANDLE_CHANNEL_STATUS(state, channels[i], status); ^ ``` **be/src/vec/sink/vdata_stream_sender.h:228:** expanded from macro 'HANDLE_CHANNEL_STATUS' ```cpp RETURN_IF_ERROR(status); \ ^ ``` **be/src/common/status.h:631:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` </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