github-actions[bot] commented on code in PR #30145:
URL: https://github.com/apache/doris/pull/30145#discussion_r1481350921
##########
be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:
##########
@@ -542,66 +512,79 @@ class InvertedIndexColumnWriterImpl : public
InvertedIndexColumnWriter {
}
Status finish() override {
Review Comment:
warning: function 'finish' has cognitive complexity of 52 (threshold 50)
[readability-function-cognitive-complexity]
```cpp
Status finish() override {
^
```
<details>
<summary>Additional context</summary>
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:514:** +1,
including nesting penalty of 0, nesting level increased to 1
```cpp
if (_dir != nullptr) {
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:521:** +2,
including nesting penalty of 1, nesting level increased to 2
```cpp
if constexpr (field_is_numeric_type(field_type)) {
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:538:** +3,
including nesting penalty of 2, nesting level increased to 3
```cpp
DBUG_EXECUTE_IF("InvertedIndexWriter._set_bkd_data_out_nullptr",
^
```
**be/src/util/debug_points.h:34:** expanded from macro 'DBUG_EXECUTE_IF'
```cpp
if (UNLIKELY(config::enable_debug_points)) {
\
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:538:** +4,
including nesting penalty of 3, nesting level increased to 4
```cpp
DBUG_EXECUTE_IF("InvertedIndexWriter._set_bkd_data_out_nullptr",
^
```
**be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
```cpp
if (dp) {
\
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:540:** +3,
including nesting penalty of 2, nesting level increased to 3
```cpp
if (data_out != nullptr && meta_out != nullptr &&
index_out != nullptr) {
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:545:** +1, nesting
level increased to 3
```cpp
} else {
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:554:** +1, nesting
level increased to 2
```cpp
} else if constexpr (field_is_slice_type(field_type)) {
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:561:** +3,
including nesting penalty of 2, nesting level increased to 3
```cpp
DBUG_EXECUTE_IF(
^
```
**be/src/util/debug_points.h:34:** expanded from macro 'DBUG_EXECUTE_IF'
```cpp
if (UNLIKELY(config::enable_debug_points)) {
\
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:561:** +4,
including nesting penalty of 3, nesting level increased to 4
```cpp
DBUG_EXECUTE_IF(
^
```
**be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
```cpp
if (dp) {
\
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:567:** +2,
including nesting penalty of 1, nesting level increased to 2
```cpp
} catch (CLuceneError& e) {
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:568:** +3,
including nesting penalty of 2, nesting level increased to 3
```cpp
FINALLY_CLOSE_OUTPUT(null_bitmap_out)
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:61:** expanded
from macro 'FINALLY_CLOSE_OUTPUT'
```cpp
} catch (...) { \
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:569:** +3,
including nesting penalty of 2, nesting level increased to 3
```cpp
FINALLY_CLOSE_OUTPUT(meta_out)
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:61:** expanded
from macro 'FINALLY_CLOSE_OUTPUT'
```cpp
} catch (...) { \
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:570:** +3,
including nesting penalty of 2, nesting level increased to 3
```cpp
FINALLY_CLOSE_OUTPUT(data_out)
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:61:** expanded
from macro 'FINALLY_CLOSE_OUTPUT'
```cpp
} catch (...) { \
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:571:** +3,
including nesting penalty of 2, nesting level increased to 3
```cpp
FINALLY_CLOSE_OUTPUT(index_out)
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:61:** expanded
from macro 'FINALLY_CLOSE_OUTPUT'
```cpp
} catch (...) { \
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:572:** +3,
including nesting penalty of 2, nesting level increased to 3
```cpp
if constexpr (field_is_numeric_type(field_type)) {
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:573:** +4,
including nesting penalty of 3, nesting level increased to 4
```cpp
FINALLY_CLOSE_OUTPUT(_dir)
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:60:** expanded
from macro 'FINALLY_CLOSE_OUTPUT'
```cpp
if (x != nullptr) x->close(); \
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:573:** +4,
including nesting penalty of 3, nesting level increased to 4
```cpp
FINALLY_CLOSE_OUTPUT(_dir)
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:61:** expanded
from macro 'FINALLY_CLOSE_OUTPUT'
```cpp
} catch (...) { \
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:574:** +1, nesting
level increased to 3
```cpp
} else if constexpr (field_is_slice_type(field_type)) {
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:575:** +4,
including nesting penalty of 3, nesting level increased to 4
```cpp
FINALLY_CLOSE_OUTPUT(_index_writer);
^
```
**be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:61:** expanded
from macro 'FINALLY_CLOSE_OUTPUT'
```cpp
} catch (...) { \
^
```
</details>
##########
be/src/olap/rowset/segment_v2/segment.cpp:
##########
@@ -114,6 +118,21 @@ Status Segment::_open() {
return Status::OK();
}
+Status Segment::_open_inverted_index() {
Review Comment:
warning: method '_open_inverted_index' can be made static
[readability-convert-member-functions-to-static]
be/src/olap/rowset/segment_v2/segment.h:204:
```diff
- Status _open_inverted_index();
+ static Status _open_inverted_index();
```
--
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]