github-actions[bot] commented on code in PR #34679:
URL: https://github.com/apache/doris/pull/34679#discussion_r1597652023
##########
be/src/io/fs/s3_file_writer.cpp:
##########
@@ -248,7 +240,7 @@ Status S3FileWriter::close() {
}
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:242:** +1, including nesting penalty of 0,
nesting level increased to 1
```cpp
if (closed() != FileWriterState::OPEN) [[unlikely]] {
^
```
**be/src/io/fs/s3_file_writer.cpp:247:** +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:247:** +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:249:** +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:251:** +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:252:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
if (_failed) {
^
```
**be/src/io/fs/s3_file_writer.cpp:255:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
if (!_pending_buf) {
^
```
**be/src/io/fs/s3_file_writer.cpp:259:** nesting level increased to 4
```cpp
[part_num = _cur_part_num,
this](UploadFileBuffer& buf) {
^
```
**be/src/io/fs/s3_file_writer.cpp:263:** 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:265:** +5, including nesting penalty of 4,
nesting level increased to 5
```cpp
if (!s.ok()) [[unlikely]] {
^
```
**be/src/io/fs/s3_file_writer.cpp:279:** nesting level increased to 4
```cpp
.set_is_cancelled([this]() { return _failed.load();
});
^
```
**be/src/io/fs/s3_file_writer.cpp:280:** +4, including nesting penalty of 3,
nesting level increased to 4
```cpp
if (_cache_builder != nullptr) {
^
```
**be/src/io/fs/s3_file_writer.cpp:292:** +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:292:** +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:301:** +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:301:** +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:307:** +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:310:** +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:311:** +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:311:** +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:315:** +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:315:** +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: [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]