github-actions[bot] commented on code in PR #40269: URL: https://github.com/apache/doris/pull/40269#discussion_r1740693625
########## be/src/olap/rowset/segment_v2/segment.cpp: ########## @@ -523,22 +549,22 @@ Status Segment::_new_iterator_with_variant_root(const TabletColumn& tablet_colum Status Segment::new_column_iterator_with_path(const TabletColumn& tablet_column, Review Comment: warning: function 'new_column_iterator_with_path' has cognitive complexity of 77 (threshold 50) [readability-function-cognitive-complexity] ```cpp Status Segment::new_column_iterator_with_path(const TabletColumn& tablet_column, ^ ``` <details> <summary>Additional context</summary> **be/src/olap/rowset/segment_v2/segment.cpp:552:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp int32_t unique_id = tablet_column.unique_id() > 0 ? tablet_column.unique_id() ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:554:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (!_sub_column_tree.contains(unique_id)) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:556:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(new_default_iterator(tablet_column, iter)); ^ ``` **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:556:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(new_default_iterator(tablet_column, iter)); ^ ``` **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:569:** nesting level increased to 1 ```cpp auto type_to_read_flat_leaves = [](ReaderType type) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:574:** +1 ```cpp type == ReaderType::READER_FULL_COMPACTION || type == ReaderType::READER_CHECKSUM; ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:577:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (opt != nullptr && type_to_read_flat_leaves(opt->io_ctx.reader_type)) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:577:** +1 ```cpp if (opt != nullptr && type_to_read_flat_leaves(opt->io_ctx.reader_type)) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:582:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (!node) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:584:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (sparse_node != nullptr && sparse_node->is_leaf_node()) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:584:** +1 ```cpp if (sparse_node != nullptr && sparse_node->is_leaf_node()) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:585:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(_new_iterator_with_variant_root( ^ ``` **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:585:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(_new_iterator_with_variant_root( ^ ``` **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:587:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:588:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(new_default_iterator(tablet_column, iter)); ^ ``` **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:588:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(new_default_iterator(tablet_column, iter)); ^ ``` **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:593:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(node->data.reader->new_iterator(&it)); ^ ``` **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:593:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(node->data.reader->new_iterator(&it)); ^ ``` **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:598:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (node != nullptr) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:599:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (node->is_leaf_node() && sparse_node == nullptr) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:599:** +1 ```cpp if (node->is_leaf_node() && sparse_node == nullptr) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:604:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(node->data.reader->new_iterator(&it)); ^ ``` **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:604:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(node->data.reader->new_iterator(&it)); ^ ``` **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:606:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:609:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(HierarchicalDataReader::create(iter, relative_path, ^ ``` **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:609:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(HierarchicalDataReader::create(iter, relative_path, ^ ``` **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:612:** +1, nesting level increased to 1 ```cpp } else { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:614:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (sparse_node != nullptr) { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:616:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(_new_iterator_with_variant_root(tablet_column, iter, root, ^ ``` **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:616:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(_new_iterator_with_variant_root(tablet_column, iter, root, ^ ``` **be/src/common/status.h:621:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:618:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:620:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(new_default_iterator(tablet_column, iter)); ^ ``` **be/src/common/status.h:619:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/rowset/segment_v2/segment.cpp:620:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(new_default_iterator(tablet_column, iter)); ^ ``` **be/src/common/status.h:621:** 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