edwardUL99 / StudSysCppCLI

A CLI UI for the StudSysCpp Project. This is a "dummy" project that is not used but done to practise C++ and also software engineering in terms of issues, issue tracking, issue refinement, requirements engineering, releases and also databases
GNU General Public License v3.0
0 stars 0 forks source link

Analyze all the code and see can you refactor it to make methods shorter #61

Closed edwardUL99 closed 4 years ago

edwardUL99 commented 4 years ago

An example of code that had to be refactored was ModuleHomePage::editAnnouncement(const Announcement &announcement). As before refactoring it, it was one huge method with a lot of duplicated code for commands like <!goto> and <!delete>. Therefore it has been pulled apart and into different subroutines handling some of the more involved commands <!goto> and <!insert> and <!delete> are examples into their own subroutines, different editing subroutines for normal editing and end of announcement etc. The code is still there just split to more clearer and readable subroutines. You could say, the editAnnouncement method is now the driver for the announcement editor.

REFACTORING IDEA: Maybe it would be best to pull all announcement stuff into an announcement page, and then do everything from there. As, currently the ModuleHomePage is cluttered with announcement stuff also, This will shorten the show method too when you are refactoring that. I will raise an issue about it

edwardUL99 commented 4 years ago

Adding test and regression labels as refactoring is done but this needs to be tested using regression to ensure functionality remains the same

edwardUL99 commented 4 years ago

Regression is covered by issue #63, so closing out this issue as it is now a duplicate issue