Skip to content

refact(alibabacloud): reduce cyclomatic complexity#6341

Draft
vflaux wants to merge 1 commit intokubernetes-sigs:masterfrom
vflaux:5419_alibaba_cylop
Draft

refact(alibabacloud): reduce cyclomatic complexity#6341
vflaux wants to merge 1 commit intokubernetes-sigs:masterfrom
vflaux:5419_alibaba_cylop

Conversation

@vflaux
Copy link
Copy Markdown
Contributor

@vflaux vflaux commented Apr 2, 2026

What does it do ?

Reduce the cyclomatic complexity of Alibaba Cloud provider.

Motivation

See #5419.

provider/alibabacloud/alibaba_cloud.go:636:1: calculated cyclomatic complexity for function updateRecords is 13, max is 10 (cyclop)
func (p *AlibabaCloudProvider) updateRecords(recordMap map[string][]alidns.Record, endpoints []*endpoint.Endpoint, hostedZoneDomains []string) {
^
provider/alibabacloud/alibaba_cloud.go:1025:1: calculated cyclomatic complexity for function updatePrivateZoneRecords is 16, max is 10 (cyclop)
func (p *AlibabaCloudProvider) updatePrivateZoneRecords(zones map[string]*alibabaPrivateZone, endpoints []*endpoint.Endpoint) {
^
provider/alibabacloud/alibaba_cloud_test.go:440:1: calculated cyclomatic complexity for function TestAlibabaCloudProvider_splitDNSName is 25, max is 10 (cyclop)
func TestAlibabaCloudProvider_splitDNSName(t *testing.T) {
^

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign raffo for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the provider Issues or PRs related to a provider label Apr 2, 2026
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 2, 2026
@vflaux vflaux changed the title chore(alibabacloud): reduce cyclomatic complexity refact(alibabacloud): reduce cyclomatic complexity Apr 2, 2026
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 23912459848

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 13 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 80.524%

Files with Coverage Reduction New Missed Lines %
alibabacloud/alibaba_cloud.go 13 63.37%
Totals Coverage Status
Change from base Build 23903893422: -0.004%
Covered Lines: 17154
Relevant Lines: 21303

💛 - Coveralls

@ivankatliarchuk
Copy link
Copy Markdown
Member

The code coverage is too low. Safer approach is in separate PR to bump code coverage first to 90+% and only then to reduce complexity. Otherwise too much effort to review where or not there is any risk or not

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. provider Issues or PRs related to a provider size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants