-
Notifications
You must be signed in to change notification settings - Fork 124
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
Decrease clusterpedia functions cyclomatic complexity #348
Comments
Hi @wuyingjun-lucky, DetailsInstructions for interacting with me using comments are available here. |
This plugin only works with pull requests.
DetailsInstructions for interacting with me using comments are available here. |
Sometimes abstracting functions that are not reused or independent enough can lead to incoherent code, and it may be clearer to distinguish a set of logic by ordered line breaks and comments. I'm not against abstracting functions, and it's good for functions that are too complex or that can be extracted to make the logic clearer. The common |
BTW, I saw some warnings that there are some linters that are deprecated. golangci-lint run
WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. This looks like it could be an good first issue, don't you think? |
yes ! |
Or we can make more comments to the complex functions. Some functions is hard . |
Yes, comments are necessary, and clusterpedia lacks a lot of them, including function names, logic within functions, and field comments within clusterpedia-io/api. We can add them and I will also add comments for some complex functions and optimize these complex functions as soon as possible. |
What would you like to be added?
Decrease clusterpedia functions cyclomatic complexity
Why is this needed?
I found some functions on clusterpedia is too long and not friendly to fresh developers.
![image](https://user-images.githubusercontent.com/16109961/189069923-4c38d1be-4a17-4bc6-8eb3-5ffdac48e809.png)
I add gocyclo to gci linters and set the min-complexity to 15 and I found many functions cyclomatic complexity are very high.
Do we have plan to improve the code complexity.
/cc @Iceber
The text was updated successfully, but these errors were encountered: