Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow variables #75

Closed
Stephen-Leibowitz opened this issue Sep 5, 2022 · 2 comments · Fixed by #80
Closed

Shadow variables #75

Stephen-Leibowitz opened this issue Sep 5, 2022 · 2 comments · Fixed by #80

Comments

@Stephen-Leibowitz
Copy link

Stephen-Leibowitz commented Sep 5, 2022

libofx/ofxconnect/ofxconnect.cpp has “bool ok” declarations on lines 143, 310, and 363. The second(inner) “ok” is in effect for lines 310-340. The third(also inner) “ok” is in effect for lines 363-447. The first(outer) “ok” is in effect for lines 143-502, except for the range of the second and third “ok”. I suggest that the inner “ok” occurrences be renamed “okay” for clarity.
Specifically, “ok” on
“second lines” 310, 320, 323, and
“third lines” 363, 375, 389, 401, 420, 426, 429
should be changed to “okay”.


libofx/ofxconnect/nodeparser.cpp:
Similarly, I think it what be more clear if local variable “list” on lines 103 and 104 were changed to “list3”. This would differentiate it from the “list” on lines 98 and 99.

@cstim
Copy link
Member

cstim commented Sep 8, 2022

I added a PR for this.

However I have to say this is super-unimportant anyway. The whole code there is quite a big mess, and the shadowed variables are just one out of many issues there. I'd propose someone cleans this up more significantly.

@Stephen-Leibowitz
Copy link
Author

My thinking is to deal with problem types one at a time. I chose shadow variables first because there are only two files involved and I am not familiar with the code. KMM also has nodeparser.cpp and its shadow variable problem.

The shadow variable problem is easy to grasp. The are other problems where I feel out of my depth. For instance, in ofxpartner.cpp the function ValidateIndexCache refers to the dead link http://moneycentral.msn.com/money/2005/mnynet/service/ols/filist.aspx?SKU=3&VER=6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants