l3r8yJ/oop-cop

PrivateMethodCheck: force programmers to introduce new class instead

h1alexbel opened this issue · 12 comments

I think we should make private methods illegal to use, long-story-short, here is main reasons "why":

  1. Private methods are not reusable between objects
  2. Private methods are not testable

consider this example:

final class Cat {
  public void meow() {
    this.print();
  }
  
  private void print() {
  }
}

OOPCOP should fail this class with a message like this:

Private method detected in Cat.java[6]. Consider creating new class instead. It's both: reusable and testable, see: $blog link (PrivateMethodCheck)

also, it should be suppressible:

@SuppressWarnings("OCOP.PrivateMethodCheck")

@l3r8yJ what do you think?

@h1alexbel thank you for reporting this. I'll assign someone to take care of it soon.

@l3r8yJ this is your task now, please go ahead. Deadline (when this ticket should be closed) is 2024-01-08T08:40:00.307453.

Estimation here is 60 minutes, that's how much you will be paid.

Remember, you don't have to solve everything in this ticket - you can solve it partially and leave todo markers in the code, which will become future tasks.

If you have any questions don't ask me, I'm not a technical person. Open new tickets instead.

If you don't have time or simply don't want to work on this, you can always resign.

@h1alexbel good idea!

@l3r8yJ please assign me

@zoeself reassign

@zoeself reassign

@l3r8yJ didn't understand that, sorry.

@zoeself resign

@zoeself resign

@l3r8yJ ok, I'll find someone else to take care of it.

@h1alexbel this is your task now, please go ahead. Deadline (when this ticket should be closed) is 2024-01-08T10:40:02.156815.

Estimation here is 60 minutes, that's how much you will be paid.

Remember, you don't have to solve everything in this ticket - you can solve it partially and leave todo markers in the code, which will become future tasks.

If you have any questions don't ask me, I'm not a technical person. Open new tickets instead.

If you don't have time or simply don't want to work on this, you can always resign.

@h1alexbel Don't forget to close this ticket before the deadline (2024-01-08T10:40:02). You are past the first half of the allowed period.

@h1alexbel Looks like you've missed the task deadline (2024-01-08T10:40:02). You are now resigned from this task.

Please stop working on it, you will not be paid. I will assign it to someone else soon.

@l3r8yJ I couldn't find any assignee for this task. This is either because there are no contributors with role DEV available or because the project does not have enough funds.

Please, make sure there is at least one available contributor with the required role and the project can afford to pay them.