Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codeclimate thresholds #4491

Open
igor-sirotin opened this issue Dec 19, 2023 · 1 comment · May be fixed by #6006
Open

Update codeclimate thresholds #4491

igor-sirotin opened this issue Dec 19, 2023 · 1 comment · May be fixed by #6006

Comments

@igor-sirotin
Copy link
Collaborator

Problem

Most of the code smells in codeclimate are:

  • ... has N methods (exceeds 21 allowed)
  • ... has N lines of code (exceeds 900 allowed)

We usually ignore those. And it makes codeclimate usnuable, because it's hard to see real problems behind this mess.

Proposal

  1. Let's increase the methods number limit. I think it's legit for such a big project as status-go
    I'd say 50 is reasonable number.
    Of course we still have Messenger and API structs which have hundrends of methods. So for these particular cases (and some other) I'd mark them as Invalid or Wontfix in codeclimate. We can come up with a list of exceptions in CONTRIBUTION.md.

  2. The number of lines limit is set to 900, this sounds big enough for me already.
    We should really consider refactoring and splitting into multiple files.
    But since we're not doing that, maybe bump it to, let's say, 1500 lines?

I'd also propose to make exceptions for *_test.go files for these 2 limits, If it's possible to configure.

Notes

If we're considering making codeclimate's test coverage required to merge PRs, then increasing this limits is essential.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment