Bug 377946

Summary: Findings from a code review
Product: [Applications] kdepimlibs Reporter: Steve <sgrubb>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: montel
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Steve 2017-03-22 18:05:09 UTC
Missing break/return:
kdepimlibs-4.14.10/akonadi/calendar/calendarmodel.cpp:115: unterminated_case: The case for value "Qt::DisplayRole" is not terminated by a 'break' statement.
kdepimlibs-4.14.10/akonadi/calendar/calendarmodel.cpp:153: fallthrough: The above case falls through to this one.

Confused code:
kdepimlibs-4.14.10/akonadi/entitylistview.cpp:193: cond_const: Condition "menuCanceled", taking false branch. Now the value of "menuCanceled" is equal to 0.
kdepimlibs-4.14.10/akonadi/entitylistview.cpp:195: const: At condition "menuCanceled", the value of "menuCanceled" must be equal to 0.
kdepimlibs-4.14.10/akonadi/entitylistview.cpp:195: dead_error_condition: The condition "menuCanceled" cannot be true.
kdepimlibs-4.14.10/akonadi/entitylistview.cpp:196: dead_error_line: Execution cannot reach this statement: "return;".

Object Passed by Value instead of Reference:
kdepimlibs-4.14.10/kcal/icalformat_p.cpp:2548: pass_by_value: Passing parameter r of type "icalrecurrencetype" (size 2904 bytes) by value.

Unterminated string possible:
kdepimlibs-4.14.10/kcalcore/versit/vobject.c:1238: buffer_size_warning: strncpy does not terminate strings if they are equal to or larger than the size passed, To be safe it needs to be manually terminated: buf1[255] = 0;
Comment 1 Laurent Montel 2017-03-22 20:20:24 UTC
4.4.10 code is closed.
Last version is 5.4.3
Regards