-
Notifications
You must be signed in to change notification settings - Fork 10
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
Refactor code to reduce code duplication #36
Comments
I entirely agree with what you have said. However there is an alternative argument that this should really be a report using the 4.x Report writer approach with all the benefits that would bring. I am not in a position to significantly refactor the plugin at the moment as I suspect it would take 3 to 5 days in total with full testing to do it correctly. However I will look at your pulls in detail in the very near future. |
Hi @marcusgreen ! Honestly I didn't expect you to work on refactoring. I have created this issues to be able to reference to it in case I would have time to do a refactoring as part of other fixes we have asked to do for the plugin. Indeed it's a big work that would need to be tested throughout. Can you please provide a bit more information about |
That sounds like an excellent plan, thank you for that detail. By a report using the 4.x approach I meant as in the api I use in this demo. |
Ah. Got it 4.x mean Moodle 4.x here. Haha :) |
I have created #37 |
While working on fixing issues #33 and #34 I found it's very difficult to apply a proper fix as there are many examples of duplicated code.
E.g. each report has it's own page that pretty much does exactly what all other report pages do, except initialising a different report class.
I think this all can be improved by:
After that basic refactoring done we can apply a proper fix for #33 as one proposed in #35 sort of workaround that actually hides code issues.
Hope that all makes sense.
The text was updated successfully, but these errors were encountered: