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


##########
be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:
##########
@@ -511,11 +515,17 @@ Status 
PipelineXFragmentContext::_create_data_sink(ObjectPool* pool, const TData
     return Status::OK();
 }
 
-Status PipelineXFragmentContext::_build_pipeline_tasks(
-        const doris::TPipelineFragmentParams& request) {
+Status PipelineXFragmentContext::_build_pipeline_x_tasks(

Review Comment:
   warning: function '_build_pipeline_x_tasks' has cognitive complexity of 53 
(threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   Status PipelineXFragmentContext::_build_pipeline_x_tasks(
                                    ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:540:** nesting 
level increased to 1
   ```cpp
       auto pre_and_submit = [&](int i, PipelineFragmentContext* ctx) {
                             ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:545:** nesting 
level increased to 2
   ```cpp
           auto init_runtime_state = [&](std::unique_ptr<RuntimeState>& 
runtime_state) {
                                     ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:551:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (request.__isset.backend_id) {
               ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:554:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (request.__isset.import_label) {
               ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:557:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (request.__isset.db_name) {
               ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:560:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (request.__isset.load_job_id) {
               ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:664:** nesting 
level increased to 2
   ```cpp
           auto prepare_and_set_parent_profile = [&](PipelineXTask* task, 
size_t pip_idx) {
                                                 ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:666:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(
               ^
   ```
   **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:666:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(
               ^
   ```
   **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:705:** +1, 
including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (target_size > 1 &&
       ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:712:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (size_t i = 0; i < target_size; i++) {
           ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:713:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(thread_pool->submit_func([&, i]() {
               ^
   ```
   **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:713:** nesting 
level increased to 4
   ```cpp
               RETURN_IF_ERROR(thread_pool->submit_func([&, i]() {
                                                        ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:718:** +5, 
including nesting penalty of 4, nesting level increased to 5
   ```cpp
                   if (prepare_done == target_size) {
                   ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:713:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(thread_pool->submit_func([&, i]() {
               ^
   ```
   **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:724:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (prepare_done != target_size) {
           ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:727:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               for (size_t i = 0; i < target_size; i++) {
               ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:728:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if (!prepare_status[i].ok()) {
                   ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:733:** +1, 
nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:734:** +2, 
including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (size_t i = 0; i < target_size; i++) {
           ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:735:** +3, 
including nesting penalty of 2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(pre_and_submit(i, this));
               ^
   ```
   **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:735:** +4, 
including nesting penalty of 3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(pre_and_submit(i, this));
               ^
   ```
   **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   
   </details>
   



##########
be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:
##########
@@ -511,11 +515,17 @@
     return Status::OK();
 }
 
-Status PipelineXFragmentContext::_build_pipeline_tasks(
-        const doris::TPipelineFragmentParams& request) {
+Status PipelineXFragmentContext::_build_pipeline_x_tasks(

Review Comment:
   warning: function '_build_pipeline_x_tasks' exceeds recommended 
size/complexity thresholds [readability-function-size]
   ```cpp
   Status PipelineXFragmentContext::_build_pipeline_x_tasks(
                                    ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:517:** 225 
lines including whitespace and comments (threshold 80)
   ```cpp
   Status PipelineXFragmentContext::_build_pipeline_x_tasks(
                                    ^
   ```
   
   </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