Skip to content
Snippets Groups Projects

Code smells iteration 3.1

Merged adityab3 requested to merge code_smells_iteration_3.1 into master
1 unresolved thread

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
Edited by adityab3

Merge request reports

Approved by

Merged by adityab3adityab3 4 years ago (Dec 7, 2020 8:08am UTC)

Merge details

  • Changes merged into master with ec7e9881.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • adityab3 marked this merge request as draft

    marked this merge request as draft

  • adityab3 changed the description

    changed the description

  • closed

  • reopened

  • adityab3 marked this merge request as ready

    marked this merge request as ready

  • adityab3 changed the description

    changed the description

  • adityab3 assigned to @htmoss2 and unassigned @adityab3

    assigned to @htmoss2 and unassigned @adityab3

    • Maintainer

      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 mjw11
    • Author Maintainer

      What did you run to check this? Also did you merge to master locally?

      Edited by adityab3
    • Maintainer

      I'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 pulled

    • Author Maintainer

      Got it, could you let me know which test are failing? This PR only changes one file, and that file doesn't have so many references, so it seems odd that it would cause that many tests to fail.

    • Maintainer

      Ok, might be the other UC that just went through, or the other code smells... On a previous commit I'm getting 22 failed already and I'm only halfway through testing.

    • Author Maintainer

      Let me try merging locally and see what tests fail.

    • Maintainer

      22 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 mjw11
    • Haha I've done that a lot. Still waiting on my tests to finish too

    • Author Maintainer

      I tried merging it into master locally and running, I get SearchUsersActionTest.testDeactivated:147 expected:<2> but was:<1> as my only error. Let's see if anyone can replicate this.

    • Maintainer

      Yep I'm getting that and 14 selenium failures for the "Merge branch 'UC14' into master'" I think it must've been on my end, but let me test your commit now

    • I 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
    • Maintainer

      @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 htmoss2
    • Maintainer

      I get a nullptrexception for DiagnosisStatisticsBeanTest

    • Maintainer

      It likely got through all the tests (I am showing 1799 unit tests) but not the selenium tests (there are like 700)

    • We fixed that one in !28 (merged)

    • Maintainer

      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
    • Please register or sign in to reply
  • mjw11 approved this merge request

    approved this merge request

  • Author Maintainer

    Just confirming that this is good to merge

  • Maintainer

    Confirm.

  • merged

  • adityab3 mentioned in commit ec7e9881

    mentioned in commit ec7e9881

Please register or sign in to reply
Loading