Futsch1/medTimer

View on GitHub

Showing 10 of 68 total issues

Method touchDivider has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

@SuppressLint("ClickableViewAccessibility")
private View.OnTouchListener touchDivider(MaterialDivider resizeHandle) {
ImageView dividerImageUp = fragmentOverview.findViewById(R.id.dividerImageUp);
ImageView dividerImageDown = fragmentOverview.findViewById(R.id.dividerImageDown);
int colorDown = MaterialColors.getColor(resizeHandle, com.google.android.material.R.attr.colorPrimary);

    Method onEntityLoaded has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    override fun onEntityLoaded(entity: Medicine, fragmentView: View): Boolean {
    fragmentView.findViewById<TextInputEditText>(R.id.amountLeft)
    .setText(MedicineHelper.formatAmount(entity.amount, ""))
    fragmentView.findViewById<TextInputEditText>(R.id.amountLeft).addDoubleValidator()
     
     

      Method onChildDrawOver has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      public void onChildDrawOver(@NonNull Canvas c, @NonNull RecyclerView recyclerView,
      RecyclerView.ViewHolder viewHolder, float dX, float dY,
      int actionState, boolean isCurrentlyActive) {
      Severity: Major
      Found in app/src/main/java/com/futsch1/medtimer/helpers/SwipeHelper.java - About 50 mins to fix

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        } else if (dismissNotificationAction.equals("1")) {
        builder.addAction(R.drawable.check2_circle, context.getString(R.string.taken), pendingTaken);
        builder.addAction(R.drawable.x_circle, context.getString(R.string.skipped), pendingDismissed);
        builder.setDeleteIntent(pendingSnooze);
        } else {
        app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 131..135
        app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 123..127

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        } else {
        builder.addAction(R.drawable.x_circle, context.getString(R.string.skipped), pendingDismissed);
        builder.addAction(R.drawable.hourglass_split, context.getString(R.string.snooze), pendingSnooze);
        builder.setDeleteIntent(pendingTaken);
        }
        app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 127..131
        app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 123..127

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        if (dismissNotificationAction.equals("0")) {
        builder.addAction(R.drawable.check2_circle, context.getString(R.string.taken), pendingTaken);
        builder.addAction(R.drawable.hourglass_split, context.getString(R.string.snooze), pendingSnooze);
        builder.setDeleteIntent(pendingDismissed);
        } else if (dismissNotificationAction.equals("1")) {
        app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 131..135
        app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 127..131

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        fragmentView.findViewById<TextInputEditText>(R.id.reminderThreshold)
        .setText(MedicineHelper.formatAmount(entity.outOfStockReminderThreshold, ""))
        app/src/main/java/com/futsch1/medtimer/medicine/MedicineStockFragment.kt on lines 53..54

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        fragmentView.findViewById<TextInputEditText>(R.id.amountLeft)
        .setText(MedicineHelper.formatAmount(entity.amount, ""))
        app/src/main/java/com/futsch1/medtimer/medicine/MedicineStockFragment.kt on lines 59..60

        Method clearCanvas has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        private void clearCanvas(Canvas c, float left, float top, float right, float bottom) {
        Severity: Minor
        Found in app/src/main/java/com/futsch1/medtimer/helpers/SwipeHelper.java - About 35 mins to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          entity.unit =
          fragmentView.findViewById<TextInputEditText>(R.id.stockUnit).text.toString()
          app/src/main/java/com/futsch1/medtimer/medicine/dialogs/NewReminderDialog.kt on lines 149..150
          Severity
          Category
          Status
          Source
          Language