Skip to content

refactor(cyclomatic): improved message for cyclomatic rule #629

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

Merged
merged 1 commit into from
Jan 31, 2022
Merged

refactor(cyclomatic): improved message for cyclomatic rule #629

merged 1 commit into from
Jan 31, 2022

Conversation

butuzov
Copy link
Contributor

@butuzov butuzov commented Jan 31, 2022

Please, describe in details what's your motivation for this PR

cyclomatic and cognitive-complexity are quite similar rules, but cognitive-complexity currenly showing max enabled so programmer don't need to open configs and check whats complexity level is targeted, however cyclomatic is missing this information.

Did you add tests?

I have updated tests.

Does your code follows the coding style of the rest of the repository?

Yes.

consolidated output of few linters from golangci-lint

-main.go:17:1: cyclomatic: function j has cyclomatic complexity 3 (revive)
+main.go:17:1: cyclomatic: function j has cyclomatic complexity 3 (> max enabled 1) (revive)
 main.go:17:1: cognitive-complexity: function j has cognitive complexity 2 (> max enabled 1) (revive)
 main.go:17:1: cyclomatic complexity 3 of func `j` is high (> 1) (gocyclo)
 main.go:17:1: cognitive complexity 2 of func `j` is high (> 1) (gocognit)

@chavacava chavacava merged commit 6545203 into mgechev:master Jan 31, 2022
@chavacava
Copy link
Collaborator

Hi @butuzov, thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants