github-actions[bot] commented on code in PR #34799: URL: https://github.com/apache/doris/pull/34799#discussion_r1599399596
########## be/src/io/fs/s3_file_writer.cpp: ########## @@ -242,7 +242,7 @@ Status S3FileWriter::_close_impl() { } Status S3FileWriter::appendv(const Slice* data, size_t data_cnt) { Review Comment: warning: function 'appendv' has cognitive complexity of 65 (threshold 50) [readability-function-cognitive-complexity] ```cpp Status S3FileWriter::appendv(const Slice* data, size_t data_cnt) { ^ ``` <details> <summary>Additional context</summary> **be/src/io/fs/s3_file_writer.cpp:244:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (state() != State::OPENED) [[unlikely]] { ^ ``` **be/src/io/fs/s3_file_writer.cpp:249:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp DBUG_EXECUTE_IF("s3_file_writer::appendv", ^ ``` **be/src/util/debug_points.h:35:** expanded from macro 'DBUG_EXECUTE_IF' ```cpp if (UNLIKELY(config::enable_debug_points)) { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:249:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp DBUG_EXECUTE_IF("s3_file_writer::appendv", ^ ``` **be/src/util/debug_points.h:37:** expanded from macro 'DBUG_EXECUTE_IF' ```cpp if (dp) { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:251:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp for (size_t i = 0; i < data_cnt; i++) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:253:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp for (size_t pos = 0, data_size_to_append = 0; pos < data_size; pos += data_size_to_append) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:254:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (_failed) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:257:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (!_pending_buf) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:261:** nesting level increased to 4 ```cpp [part_num = _cur_part_num, this](UploadFileBuffer& buf) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:265:** nesting level increased to 4 ```cpp .set_sync_after_complete_task([this, part_num = _cur_part_num](Status s) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:267:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp if (!s.ok()) [[unlikely]] { ^ ``` **be/src/io/fs/s3_file_writer.cpp:281:** nesting level increased to 4 ```cpp .set_is_cancelled([this]() { return _failed.load(); }); ^ ``` **be/src/io/fs/s3_file_writer.cpp:282:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (_cache_builder != nullptr) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:294:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(builder.build(&_pending_buf)); ^ ``` **be/src/common/status.h:570:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:294:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(builder.build(&_pending_buf)); ^ ``` **be/src/common/status.h:572:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:303:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(_pending_buf->append_data( ^ ``` **be/src/common/status.h:570:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:303:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(_pending_buf->append_data( ^ ``` **be/src/common/status.h:572:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:309:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (_pending_buf->get_size() == buffer_size) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:312:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (_cur_part_num == 1) { ^ ``` **be/src/io/fs/s3_file_writer.cpp:313:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(_create_multi_upload_request()); ^ ``` **be/src/common/status.h:570:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:313:** +6, including nesting penalty of 5, nesting level increased to 6 ```cpp RETURN_IF_ERROR(_create_multi_upload_request()); ^ ``` **be/src/common/status.h:572:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:317:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(FileBuffer::submit(std::move(_pending_buf))); ^ ``` **be/src/common/status.h:570:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/io/fs/s3_file_writer.cpp:317:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(FileBuffer::submit(std::move(_pending_buf))); ^ ``` **be/src/common/status.h:572:** 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