Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

EVEREST-482 Removed nolint:funlen,cyclop directives #202

Merged
merged 5 commits into from
Oct 6, 2023
Merged

Conversation

gen1us2k
Copy link
Contributor

@gen1us2k gen1us2k commented Sep 29, 2023

EVEREST-482 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
EVEREST-482

Short explanation of the problem.
We shut some linters intentionally in the past

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Short explanation of the solution we are providing with this PR.

The linter complains about cyclomatic complexity of 11 or 12 and I didn't see any other option instead of increasing this to 15. 15 is good enough and I had the setting for 30 in the past. Having the default setting for funlen and max-complexity set to 15 will prevent us from writing huge functions.

I refactored functions that had funlen issues but the rest of functions with //nolint:cyclop they had a cyclomatic complexity of 11 or 12 and there's no sane way to refactor them

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?

Tests

  • Is an Integration test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

@gen1us2k gen1us2k marked this pull request as ready for review September 29, 2023 13:03
@gen1us2k gen1us2k requested a review from a user September 29, 2023 13:03
@recharte
Copy link
Collaborator

Can we start being strict with the PR description from now on? I'm seeing many PRs being opened with the default template.
I know that this particular PR doesn't add any new functionality or fix any bug but if we slack on these PRs we'll start slacking on any PR. Let's do a team effort to fill the template correctly for every PR.

@gen1us2k
Copy link
Contributor Author

Can we start being strict with the PR description from now on? I'm seeing many PRs being opened with the default template.
I know that this particular PR doesn't add any new functionality or fix any bug but if we slack on these PRs we'll start slacking on any PR. Let's do a team effort to fill the template correctly for every PR.

I agree. I was in the middle of filling it

Copy link
Contributor

@oksana-grishchenko oksana-grishchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thinks it's still ok to have 15 as max complexity. In case of API method handlers we need to do many different things in it and sometimes splitting the method into smaller brings more confusion than if we have all logic plain.

@gen1us2k gen1us2k enabled auto-merge (squash) October 5, 2023 12:30
api/monitoring_instance.go Show resolved Hide resolved
@gen1us2k gen1us2k merged commit 39fe63c into main Oct 6, 2023
4 checks passed
@gen1us2k gen1us2k deleted the EVEREST-482 branch October 6, 2023 10:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants