-
Notifications
You must be signed in to change notification settings - Fork 2
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
[ 2375000 ] Code clarification wanted #271
Comments
Addendum: Hi Son, please find below a piece of pseudo code, that would be in my opinion a better solution, because this is much more well arranged and easier to understand and to maintain than the current code and avoids a lot of redundancy. Therefore please try to integrate this concept into your current implementation.
|
Hello Holger, Thank you very much for the hint! I improved the code related to configuration level as your suggestion. Thank you, |
Ready for sprint 0.13.1 [06.09.24](jsonpreprocessor / tsm) |
Hi Son, the code is improved now a bit, but unfortunately is still long winded and difficult to understand. Example:
If it's level 2, it cannot be level 1. Therefore there is no need to spend two lines of code:
And please rename Everyone who reads this
will assume that Later in the code you implement the following mapping:
Why is this necessary? Why not in this way:
In I already gave a clear recommendation about how to implement the configuration load in a plausible and easy to understand way. Please follow this recommendation and rework your code again. |
Hello Holger, Thank you for your suggestions! Due to numerous changes in the requirements, the structure and flow of the code are not well-organized. I will refactor the code for this method. Thank you, |
Hi Son, please consider both Why is it necessary to have all these if conditions belonging to the configuration, present in two different files? My actual understanding is that in For example this code:
Why is this not done in |
Hello Holger, I pushed the refactoring code to stabi branch. Could you please help me review and give your feedback? Thank you, |
Hi Son, [1] Please remove the invalid 'three dots' example in the docstring of class [2] Please shorten the code. This really hurts:
And caution: The value of Then you can do this (and this is much shorter):
[3] I still have doubts w.r.t. #271 (comment) Do you see any possibility to have a better separation of concerns between |
Little goodie wanted: Sometimes, when I am not so deep inside the TestsuitesManagement stuff any more, it is difficult for me to get the meaning of messages like:
This is similar to those magic numbers in code, that are also not wanted. With the help of something like
is is possible to provide feedback about the configuration level in this format:
That is in my opinion more helpful - and is already realized in: test-fullautomation/RobotFramework_AIO#235 (comment) If you make levels_info a part of your TestsuitesManagement configuration (e.g. |
Hello Holger, The code
was removed and replaced by new code to present data table format as attached file. I also updated the level info as your suggestion above. Thank you, |
Hi Son, the code is improved a lot and I really would prefer to close the issue because it has already become too big. Nevertheless, I still would prefer to have the code more plausible and easier to understand. This is an extract of some lines in
This is a curious mixture of checking already detected levels ( Intuitively I would have expected something like this:
I already made a corresponding proposal here: The idea behind this proposal is to have a good separation between the detection of the config level (= checking Please give this proposal a try. It would make the code much easier to understand and to maintain. |
Hi Son,
for me the following code looks very long winded:
Is it really required to have a separate boolean level flag for every level? During runtime only one certain level can be chosen. Why not a single integer variable holding the level number? This would prevent you from maintaining four different variables (including the need to make sure that they have consistent values - only one of them can be True, but not more than one).
And this:
is in my opinion an invalid assumption. Your code also contains
bLevel4
. Therefore you have to ask also this variable which configuration level is active.At least I would expect an explicit check like:
It is also not necessary to have
RobotFramework_TestsuitesManagement.CTestsuitesCfg.oConfig.loadCfg(RobotFramework_TestsuitesManagement.CTestsuitesCfg.oConfig)
twice in the code. Move this line to outside if/else.
The text was updated successfully, but these errors were encountered: