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


##########
be/src/runtime/plan_fragment_executor.cpp:
##########
@@ -113,7 +113,7 @@ PlanFragmentExecutor::~PlanFragmentExecutor() {
 }
 
 Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request) {

Review Comment:
   warning: function 'prepare' has cognitive complexity of 62 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
   Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request) 
{
                                ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/runtime/plan_fragment_executor.cpp:115:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.__isset.query_options && 
request.query_options.__isset.execution_timeout) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:115:** +1
   ```cpp
       if (request.__isset.query_options && 
request.query_options.__isset.execution_timeout) {
                                         ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:135:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.__isset.backend_id) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:138:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.__isset.import_label) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:141:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.__isset.db_name) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:144:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.__isset.load_job_id) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:147:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.__isset.wal_id) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:150:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.__isset.content_length) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:154:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.query_options.__isset.is_report_success) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:159:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.is_simplified_param) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:161:** +1, nesting level 
increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:163:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:163:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:170:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       RETURN_IF_ERROR_OR_CATCH_EXCEPTION(ExecNode::create_tree(
       ^
   ```
   **be/src/common/exception.h:105:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
       do {                                                                     
                    \
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:170:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
       RETURN_IF_ERROR_OR_CATCH_EXCEPTION(ExecNode::create_tree(
       ^
   ```
   **be/src/common/exception.h:111:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
                   if (UNLIKELY(!_status_.ok())) {                              
                    \
                   ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:170:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
       RETURN_IF_ERROR_OR_CATCH_EXCEPTION(ExecNode::create_tree(
       ^
   ```
   **be/src/common/exception.h:115:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
           } catch (const doris::Exception& e) {                                
                    \
             ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:170:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
       RETURN_IF_ERROR_OR_CATCH_EXCEPTION(ExecNode::create_tree(
       ^
   ```
   **be/src/common/exception.h:116:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
               if (e.code() == doris::ErrorCode::MEM_ALLOC_FAILED) {            
                    \
               ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:184:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       RETURN_IF_ERROR(_plan->prepare(_runtime_state.get()));
       ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:184:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
       RETURN_IF_ERROR(_plan->prepare(_runtime_state.get()));
       ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:192:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       for (int i = 0; i < scan_nodes.size(); ++i) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:195:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (typeid(*node) == typeid(vectorized::NewOlapScanNode) ||
           ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:199:** +1
   ```cpp
               typeid(*node) == typeid(vectorized::NewJdbcScanNode) ||
                                                                    ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:205:** +1, nesting level 
increased to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:222:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (request.fragment.__isset.output_sink) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:223:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR_OR_CATCH_EXCEPTION(
           ^
   ```
   **be/src/common/exception.h:105:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
       do {                                                                     
                    \
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:223:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR_OR_CATCH_EXCEPTION(
           ^
   ```
   **be/src/common/exception.h:111:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
                   if (UNLIKELY(!_status_.ok())) {                              
                    \
                   ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:223:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR_OR_CATCH_EXCEPTION(
           ^
   ```
   **be/src/common/exception.h:115:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
           } catch (const doris::Exception& e) {                                
                    \
             ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:223:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
           RETURN_IF_ERROR_OR_CATCH_EXCEPTION(
           ^
   ```
   **be/src/common/exception.h:116:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
               if (e.code() == doris::ErrorCode::MEM_ALLOC_FAILED) {            
                    \
               ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:227:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_sink->prepare(runtime_state()));
           ^
   ```
   **be/src/common/exception.h:105:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
       do {                                                                     
                    \
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:227:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_sink->prepare(runtime_state()));
           ^
   ```
   **be/src/common/exception.h:111:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
                   if (UNLIKELY(!_status_.ok())) {                              
                    \
                   ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:227:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_sink->prepare(runtime_state()));
           ^
   ```
   **be/src/common/exception.h:115:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
           } catch (const doris::Exception& e) {                                
                    \
             ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:227:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
           RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_sink->prepare(runtime_state()));
           ^
   ```
   **be/src/common/exception.h:116:** expanded from macro 
'RETURN_IF_ERROR_OR_CATCH_EXCEPTION'
   ```cpp
               if (e.code() == doris::ErrorCode::MEM_ALLOC_FAILED) {            
                    \
               ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:229:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (sink_profile != nullptr) {
           ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:232:** +1, nesting level 
increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:238:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (sink_profile != nullptr) {
       ^
   ```
   **be/src/runtime/plan_fragment_executor.cpp:240:** +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

Reply via email to