Bug 459020

Summary: noError and 2 Other Issues
Product: [Applications] kmymoney Reporter: Stephen Leibowitz <LibreStephen>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: minor CC: LibreStephen, ralf.habacker
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In: 5.1.0
Sentry Crash Report:

Description Stephen Leibowitz 2022-09-12 13:11:13 UTC
1. Remove noError. The variable noError in MyMoneyQifWriter::writeInvestmentEntry  seems unnecessary. Here is its declaration at the top level of the function: 
bool noError = true;

There are 10 “if (noError) {” lines. There is one place where noError is given a value, aside from the declaration statement, but that value is not used:
noError = false;
return;

2. Shadow Variable. kmymoney/plugins/ofx/import/nodeparser.cpp has “list” declared on lines 78 and 81. The second(inner) “list” is visible for lines 81-88. The first(outer) “list” is visible for lines 78-90, except for the scope of the second “list”. I suggest that the second(inner) “list” be renamed “list3” for clarity.

3. Argument Name Mismatch in kmymoney/plugins/ofx/import/ofxpartner.cpp. 
The first argument to the definition of function OfxHttpRequest on line 284 is “type”. I suggest it be changed to “method” to match the .h file. It should also be changed on line 322. The argument refers to HTTP request methods, such as "get". See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods

The function is used with the argument "POST" on line 396 of 
kmymoney/plugins/ofx/import/dialogs/konlinebankingsetupwizard.cpp
Comment 1 Thomas Baumgart 2022-09-13 06:16:07 UTC
Git commit ab95f6f1803646ec759b5940eefe78674784b05c by Thomas Baumgart.
Committed on 13/09/2022 at 06:15.
Pushed by tbaumgart into branch 'master'.

Rename argument to better reflect purpose

M  +7    -2    kmymoney/plugins/ofx/import/ofxpartner.cpp

https://invent.kde.org/office/kmymoney/commit/ab95f6f1803646ec759b5940eefe78674784b05c
Comment 2 Thomas Baumgart 2022-09-13 06:16:15 UTC
Git commit 67023afda6347d100eb578a24ee7863b38277df3 by Thomas Baumgart.
Committed on 13/09/2022 at 06:15.
Pushed by tbaumgart into branch 'master'.

Remove dead code

D  +0    -113  kmymoney/plugins/ofx/import/nodeparser.cpp
D  +0    -30   kmymoney/plugins/ofx/import/nodeparser.h
M  +16   -44   kmymoney/plugins/qif/export/mymoneyqifwriter.cpp

https://invent.kde.org/office/kmymoney/commit/67023afda6347d100eb578a24ee7863b38277df3