github-actions[bot] commented on code in PR #35883:
URL: https://github.com/apache/doris/pull/35883#discussion_r1631499380


##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -675,10 +674,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:676:** 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:
##########
@@ -3435,10 +3440,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:3442:** 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:
##########
@@ -675,10 +674,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:678:** +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:689:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (ptr < end) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:690:** +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:693:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (*ptr != '%' || (ptr + 1) == end) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:693:** +1
   ```cpp
           if (*ptr != '%' || (ptr + 1) == end) {
                           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:699:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           switch (ch = *ptr++) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:750:** +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:750:** +1
   ```cpp
               if (_type == TIME_TIME || (_year == 0 && _month == 0)) {
                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:750:** +1
   ```cpp
               if (_type == TIME_TIME || (_year == 0 && _month == 0)) {
                                                     ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:757:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_month == 0) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:771:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_day >= 10 && _day <= 19) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:771:** +1
   ```cpp
               if (_day >= 10 && _day <= 19) {
                              ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:773:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:774:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   switch (_day % 10) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:817:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_month == 0) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:824:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if ((_hour % 24) >= 12) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:826:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:842:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if ((_hour % 24) >= 12) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:844:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:864:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:874:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:884:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:894:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:903:** +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:903:** +1
   ```cpp
               if (_type == TIME_TIME || (_month == 0 && _year == 0)) {
                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:903:** +1
   ```cpp
               if (_type == TIME_TIME || (_month == 0 && _year == 0)) {
                                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:916:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:929:** +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: 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

Reply via email to