Code smells iteration 3.1
This PR resolves code smells in the file ViewDiagnosisStatisticsAction.java
. It includes the following changes:
- Removed unused imports
- Replaced magic numbers with references to constants
- Shortened long methods, and extracted repeated code into helper functions (DRY)
- Simplified complex boolean expression by extracting components to local variables
- Shortened lines longer than 100 chars
- cleaned up stale comments
Merge request reports
Activity
These changes cause more tests to fail than the previous 15, this causes 23. This might also be from the previous merges, I am checking into that now.
Edited by mjw11What did you run to check this? Also did you merge to master locally?
Edited by adityab3I'm using intellij then right clicking on the tests folder, and clicking run all tests. I'm trying to find a way to do this on command line for all you doing this on the VM, I'm running ubuntu on my PC. I did not merge to master locally, I made a different branch locally and then
git pull
ed22 have failed from this previous revision, so you must have 1 test failure...
Let me see if I can get this command line command to run all 2345 tests. Give me 10 mins.
Edit: Heh some of this might be on me I forgot to mvn install XD
Edited by mjw11I just finished testing it on the code_smells branch and got 12 errors:
AppointmentTest.testViewApptWithConflicts:163 » NoSuchElement No link found wi... AppointmentTypeTest.testPatientViewUpcomingAppointments:134 » NoSuchElement No... ViewTransactionLogsTest.testAdminImpossibleDate:271 » NoSuchElement No link fo... ViewTransactionLogsTest.testAdminIncorrectDate:236 » NoSuchElement No link fou... ViewTransactionLogsTest.testAdminLogin:27 » NoSuchElement No link found with t... ViewTransactionLogsTest.testAdminNoResults:305 » NoSuchElement No link found w... ViewTransactionLogsTest.testAdminRegular:45 » NoSuchElement No link found with... ViewTransactionLogsTest.testAdminSelectMainRole:113 » NoSuchElement No link fo... ViewTransactionLogsTest.testAdminSelectSecondaryRole:155 » NoSuchElement No li... ViewTransactionLogsTest.testAdminSelectType:197 » NoSuchElement No link found ... ViewTransactionLogsTest.testTesterLogin:36 » NoSuchElement No link found with ... ViewTransactionLogsTest.testTesterRegular:79 » NoSuchElement No link found wit...
Edited by htmoss2@htmoss2 interesting... I'm getting the ones that I posted on Slack for the most part, and am running this branches tests rn, we shall see the results in a few mins
Okay I just ran it on a local version of master with the new code smells and just got
Failed tests: SearchUsersActionTest.testDeactivated:147 expected:<2> but was:<1> Tests run: 1795, Failures: 1, Errors: 0, Skipped: 0
Does that mean it got through all the tests though or just stopped at the first one?
Edited by htmoss2We fixed that one in !28 (merged)
Nice, I'm seeing that too. So we have all good tests on this branch. Approving the merge.
I see the same amount as on master, and we've had 15 total failing for at least half the day.
Edited by mjw11
mentioned in commit ec7e9881