github-actions[bot] commented on code in PR #36158:
URL: https://github.com/apache/doris/pull/36158#discussion_r1635774851
##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -3421,10 +3426,12 @@
}
template <typename T>
-bool DateV2Value<T>::to_format_string(const char* format, int len, char* to)
const {
+bool DateV2Value<T>::to_format_string_conservative(const char* format, int
len, char* to,
Review Comment:
warning: function 'to_format_string_conservative' exceeds recommended
size/complexity thresholds [readability-function-size]
```cpp
bool DateV2Value<T>::to_format_string_conservative(const char* format, int
len, char* to,
^
```
<details>
<summary>Additional context</summary>
**be/src/vec/runtime/vdatetime_value.cpp:3428:** 256 lines including
whitespace and comments (threshold 80)
```cpp
bool DateV2Value<T>::to_format_string_conservative(const char* format, int
len, char* to,
^
```
</details>
##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -673,10 +672,12 @@
return dst + 4;
}
-bool VecDateTimeValue::to_format_string(const char* format, int len, char* to)
const {
+bool VecDateTimeValue::to_format_string_conservative(const char* format, int
len, char* to,
Review Comment:
warning: function 'to_format_string_conservative' exceeds recommended
size/complexity thresholds [readability-function-size]
```cpp
bool VecDateTimeValue::to_format_string_conservative(const char* format, int
len, char* to,
^
```
<details>
<summary>Additional context</summary>
**be/src/vec/runtime/vdatetime_value.cpp:674:** 270 lines including
whitespace and comments (threshold 80)
```cpp
bool VecDateTimeValue::to_format_string_conservative(const char* format, int
len, char* to,
^
```
</details>
##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -673,10 +672,12 @@ char* write_four_digits_to_string(int number, char* dst) {
return dst + 4;
}
-bool VecDateTimeValue::to_format_string(const char* format, int len, char* to)
const {
+bool VecDateTimeValue::to_format_string_conservative(const char* format, int
len, char* to,
Review Comment:
warning: function 'to_format_string_conservative' has cognitive complexity
of 60 (threshold 50) [readability-function-cognitive-complexity]
```cpp
bool VecDateTimeValue::to_format_string_conservative(const char* format, int
len, char* to,
^
```
<details>
<summary>Additional context</summary>
**be/src/vec/runtime/vdatetime_value.cpp:676:** +1, including nesting
penalty of 0, nesting level increased to 1
```cpp
if (check_range(_year, _month, _day, _hour, _minute, _second, _type)) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:687:** +1, including nesting
penalty of 0, nesting level increased to 1
```cpp
while (ptr < end) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:688:** +2, including nesting
penalty of 1, nesting level increased to 2
```cpp
if (to - begin + SAFE_FORMAT_STRING_MARGIN > max_valid_length)
[[unlikely]] {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:691:** +2, including nesting
penalty of 1, nesting level increased to 2
```cpp
if (*ptr != '%' || (ptr + 1) == end) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:691:** +1
```cpp
if (*ptr != '%' || (ptr + 1) == end) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:697:** +2, including nesting
penalty of 1, nesting level increased to 2
```cpp
switch (ch = *ptr++) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:748:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_type == TIME_TIME || (_year == 0 && _month == 0)) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:748:** +1
```cpp
if (_type == TIME_TIME || (_year == 0 && _month == 0)) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:748:** +1
```cpp
if (_type == TIME_TIME || (_year == 0 && _month == 0)) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:755:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_month == 0) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:769:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_day >= 10 && _day <= 19) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:769:** +1
```cpp
if (_day >= 10 && _day <= 19) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:771:** +1, nesting level increased
to 3
```cpp
} else {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:772:** +4, including nesting
penalty of 3, nesting level increased to 4
```cpp
switch (_day % 10) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:815:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_month == 0) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:822:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if ((_hour % 24) >= 12) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:824:** +1, nesting level increased
to 3
```cpp
} else {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:840:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if ((_hour % 24) >= 12) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:842:** +1, nesting level increased
to 3
```cpp
} else {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:862:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_type == TIME_TIME) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:872:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_type == TIME_TIME) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:882:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_type == TIME_TIME) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:892:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_type == TIME_TIME) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:901:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_type == TIME_TIME || (_month == 0 && _year == 0)) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:901:** +1
```cpp
if (_type == TIME_TIME || (_month == 0 && _year == 0)) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:901:** +1
```cpp
if (_type == TIME_TIME || (_month == 0 && _year == 0)) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:914:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_type == TIME_TIME) {
^
```
**be/src/vec/runtime/vdatetime_value.cpp:927:** +3, including nesting
penalty of 2, nesting level increased to 3
```cpp
if (_type == TIME_TIME) {
^
```
</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]