Skip to content

Resolve "Replace gocyclo linter with gocognit"

Pedro Pombeiro requested to merge 25946-gocognit-linter into master

What does this MR do?

This MR replaces the gocyclo linter which uses a simplistic complexity counter, with gocognit which uses a more realistic complexity rule.

Why was this MR needed?

To make sure we don't allow overly complex code in our MRs.

Are there points in the code the reviewer needs to double check?

  • I raised the min-complexity from 10 to 15, since the count is logically higher for gocognit due to the way it is calculated.
  • I needed to turn it off in tests, since some tests reach complexity count of 67 (e.g. executors/kubernetes/kubernetes_test.go:814:1).

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Closes #25946 (closed)

Edited by Pedro Pombeiro

Merge request reports