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


##########
be/src/vec/exec/scan/vfile_scanner.cpp:
##########
@@ -713,7 +713,7 @@ void VFileScanner::_truncate_char_or_varchar_column(Block* 
block, int idx, int l
 Status VFileScanner::_get_next_reader() {

Review Comment:
   warning: function '_get_next_reader' has cognitive complexity of 106 
(threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   Status VFileScanner::_get_next_reader() {
                        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/exec/scan/vfile_scanner.cpp:713:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (true) {
       ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:714:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (_cur_reader) {
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:715:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(_cur_reader->close());
               ^
   ```
   **be/src/common/status.h:523:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:715:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(_cur_reader->close());
               ^
   ```
   **be/src/common/status.h:525:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:719:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (_next_range >= _ranges.size()) {
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:724:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (_next_range != 0) {
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:737:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (format_type == TFileFormatType::FORMAT_JNI && 
range.__isset.table_format_params &&
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:739:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (range.table_format_params.hudi_params.delta_logs.empty()) {
               ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:745:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           switch (format_type) {
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:747:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_real_tuple_desc->table_desc()->table_type() ==
               ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:756:** +1, nesting level increased 
to 3
   ```cpp
               } else if (range.__isset.table_format_params &&
                      ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:756:** +1
   ```cpp
               } else if (range.__isset.table_format_params &&
                                                            ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:762:** +1, nesting level increased 
to 3
   ```cpp
               } else if (range.__isset.table_format_params &&
                      ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:762:** +1
   ```cpp
               } else if (range.__isset.table_format_params &&
                                                            ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:782:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
                   RETURN_IF_ERROR(parquet_reader->open());
                   ^
   ```
   **be/src/common/status.h:523:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:782:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   RETURN_IF_ERROR(parquet_reader->open());
                   ^
   ```
   **be/src/common/status.h:525:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:784:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (push_down_predicates) {
               ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:785:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   RETURN_IF_ERROR(_process_late_arrival_conjuncts());
                   ^
   ```
   **be/src/common/status.h:523:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:785:** +5, including nesting 
penalty of 4, nesting level increased to 5
   ```cpp
                   RETURN_IF_ERROR(_process_late_arrival_conjuncts());
                   ^
   ```
   **be/src/common/status.h:525:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:787:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (range.__isset.table_format_params &&
               ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:787:** +1
   ```cpp
               if (range.__isset.table_format_params &&
                                                     ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:798:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   RETURN_IF_ERROR(iceberg_reader->init_row_filters(range));
                   ^
   ```
   **be/src/common/status.h:523:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:798:** +5, including nesting 
penalty of 4, nesting level increased to 5
   ```cpp
                   RETURN_IF_ERROR(iceberg_reader->init_row_filters(range));
                   ^
   ```
   **be/src/common/status.h:525:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:800:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:816:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (push_down_predicates) {
               ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:817:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   RETURN_IF_ERROR(_process_late_arrival_conjuncts());
                   ^
   ```
   **be/src/common/status.h:523:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:817:** +5, including nesting 
penalty of 4, nesting level increased to 5
   ```cpp
                   RETURN_IF_ERROR(_process_late_arrival_conjuncts());
                   ^
   ```
   **be/src/common/status.h:525:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:819:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (range.__isset.table_format_params &&
               ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:819:** +1
   ```cpp
               if (range.__isset.table_format_params &&
                                                     ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:829:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   RETURN_IF_ERROR(tran_orc_reader->init_row_filters(range));
                   ^
   ```
   **be/src/common/status.h:523:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:829:** +5, including nesting 
penalty of 4, nesting level increased to 5
   ```cpp
                   RETURN_IF_ERROR(tran_orc_reader->init_row_filters(range));
                   ^
   ```
   **be/src/common/status.h:525:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:831:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:879:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (init_status.is<END_OF_FILE>()) {
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:882:** +1, nesting level increased 
to 2
   ```cpp
           } else if (!init_status.ok()) {
                  ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:883:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (init_status.is<ErrorCode::NOT_FOUND>()) {
               ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:897:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_generate_fill_columns());
           ^
   ```
   **be/src/common/status.h:523:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:897:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_generate_fill_columns());
           ^
   ```
   **be/src/common/status.h:525:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:898:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (VLOG_NOTICE_IS_ON && !_missing_cols.empty() && _is_load) {
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:910:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (_state->query_options().truncate_char_or_varchar_columns && 
need_to_get_parsed_schema) {
           ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:910:** +1
   ```cpp
           if (_state->query_options().truncate_char_or_varchar_columns && 
need_to_get_parsed_schema) {
                                                                        ^
   ```
   **be/src/vec/exec/scan/vfile_scanner.cpp:913:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (!status.ok() && status.code() != 
TStatusCode::NOT_IMPLEMENTED_ERROR) {
               ^
   ```
   
   </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]

Reply via email to