Skip to content
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 cyclomatic complexity #2646

Closed
ainar-g opened this issue Feb 5, 2021 · 2 comments
Closed

Decrease cyclomatic complexity #2646

ainar-g opened this issue Feb 5, 2021 · 2 comments
Assignees
Labels
enhancement P4: Low recurrent Issues about things that need to be done several times.
Milestone

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Feb 5, 2021

Right now we set gocyclo to allow the maximum cyclomatic complexly of of 20. McCabe originally recommended to limit the value to no more than 10, but NIST later observed that values up to 15 may be allowed in some cases. I think we should at least strive to decrease it to 15 and see if continuing will do more good than harm.

I also don't think that decreasing it all in one go is a good choice, so I'll make this ticket a recurrent one and gradually decrease the complexity as we go.

@ainar-g ainar-g added enhancement P4: Low recurrent Issues about things that need to be done several times. labels Feb 5, 2021
@ainar-g ainar-g self-assigned this Feb 5, 2021
@ainar-g ainar-g added this to the v0.106.0 milestone Feb 5, 2021
adguard pushed a commit that referenced this issue Feb 5, 2021
Merge in DNS/adguard-home from less-cyclo to master

Updates #2646.

Squashed commit of the following:

commit 42f81c9
Merge: f61e236 42b88c3
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Feb 5 15:07:04 2021 +0300

    Merge branch 'master' into less-cyclo

commit f61e236
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Feb 5 15:06:02 2021 +0300

    home: imp docs

commit e3c2310
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Jan 27 21:14:30 2021 +0300

    all: imp cyclomatic complexity, minor improvements
adguard pushed a commit that referenced this issue Feb 9, 2021
Merge in DNS/adguard-home from imp-upgrade-test to master

Updates #2639.
Updates #2646.

Squashed commit of the following:

commit f7bd8e0
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 9 16:38:40 2021 +0300

    home: imp test more

commit 5b64131
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 9 16:09:22 2021 +0300

    home: imp upgrade test
adguard pushed a commit that referenced this issue Mar 24, 2021
Updates #1401.
Updates #2646.

Squashed commit of the following:

commit 93b025a
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 24 16:41:07 2021 +0300

    home: fix migration, imp code
adguard pushed a commit that referenced this issue Mar 25, 2021
Updates #2646.

Squashed commit of the following:

commit c83c230
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 19:47:11 2021 +0300

    all: imp code, decr cyclo
adguard pushed a commit that referenced this issue Mar 26, 2021
Updates #2646.

Squashed commit of the following:

commit c153f08
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 21:03:51 2021 +0300

    dnsfilter: imp code, decr cyclo
adguard pushed a commit that referenced this issue Mar 26, 2021
Updates #2646.

Squashed commit of the following:

commit b362aff
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 21:13:30 2021 +0300

    dnsforward: imp code, decr cyclo
@ainar-g
Copy link
Contributor Author

ainar-g commented Mar 26, 2021

We were able to decrease the maximum complexity to 17 in this cycle. We'll try to reach 15 in the next cycle.

@ainar-g ainar-g modified the milestones: v0.106.0, v0.107.0 Mar 26, 2021
adguard pushed a commit that referenced this issue May 20, 2021
Updates #2646.

Squashed commit of the following:

commit 0a5ff6a
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu May 20 14:07:08 2021 +0300

    home: imp code

commit 2af0f46
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu May 20 13:48:08 2021 +0300

    home: imp whois parse
adguard pushed a commit that referenced this issue May 31, 2021
Updates #2646,

Squashed commit of the following:

commit af6a6fa
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon May 31 20:00:36 2021 +0300

    all: imp code, docs

commit 1cd4781
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon May 31 18:51:23 2021 +0300

    all: imp cyclo in new code
@ainar-g
Copy link
Contributor Author

ainar-g commented Oct 25, 2021

There'll be a lot of rewrites in v0.108.0, so I'll move the issue there.

@ainar-g ainar-g modified the milestones: v0.107.0, v0.108.0 Oct 25, 2021
adguard pushed a commit that referenced this issue Mar 1, 2023
Updates #2646.

Squashed commit of the following:

commit 9db0df7
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 1 13:24:12 2023 +0300

    home: imp docs

commit d1e4199
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 1 13:19:42 2023 +0300

    home: imp docs, names

commit 1763686
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 28 20:45:50 2023 +0300

    all: imp cyclo, docs; use netip.Addr
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
…mprovements

Merge in DNS/adguard-home from less-cyclo to master

Updates AdguardTeam#2646.

Squashed commit of the following:

commit 42f81c9
Merge: f61e236 42b88c3
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Feb 5 15:07:04 2021 +0300

    Merge branch 'master' into less-cyclo

commit f61e236
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Feb 5 15:06:02 2021 +0300

    home: imp docs

commit e3c2310
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Jan 27 21:14:30 2021 +0300

    all: imp cyclomatic complexity, minor improvements
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from imp-upgrade-test to master

Updates AdguardTeam#2639.
Updates AdguardTeam#2646.

Squashed commit of the following:

commit f7bd8e0
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 9 16:38:40 2021 +0300

    home: imp test more

commit 5b64131
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 9 16:09:22 2021 +0300

    home: imp upgrade test
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#1401.
Updates AdguardTeam#2646.

Squashed commit of the following:

commit 93b025a
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 24 16:41:07 2021 +0300

    home: fix migration, imp code
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#2646.

Squashed commit of the following:

commit c83c230
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 19:47:11 2021 +0300

    all: imp code, decr cyclo
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#2646.

Squashed commit of the following:

commit c153f08
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 21:03:51 2021 +0300

    dnsfilter: imp code, decr cyclo
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#2646.

Squashed commit of the following:

commit b362aff
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 25 21:13:30 2021 +0300

    dnsforward: imp code, decr cyclo
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#2646.

Squashed commit of the following:

commit 0a5ff6a
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu May 20 14:07:08 2021 +0300

    home: imp code

commit 2af0f46
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu May 20 13:48:08 2021 +0300

    home: imp whois parse
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#2646,

Squashed commit of the following:

commit af6a6fa
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon May 31 20:00:36 2021 +0300

    all: imp code, docs

commit 1cd4781
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon May 31 18:51:23 2021 +0300

    all: imp cyclo in new code
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Updates AdguardTeam#2646.

Squashed commit of the following:

commit 9db0df7
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 1 13:24:12 2023 +0300

    home: imp docs

commit d1e4199
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 1 13:19:42 2023 +0300

    home: imp docs, names

commit 1763686
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 28 20:45:50 2023 +0300

    all: imp cyclo, docs; use netip.Addr
@ainar-g ainar-g removed this from the v0.108.0 milestone May 25, 2023
@ainar-g ainar-g added this to the v0.107.30 milestone May 25, 2023
@ainar-g ainar-g closed this as completed May 25, 2023
@ainar-g ainar-g modified the milestones: v0.107.31, v0.107.30 Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement P4: Low recurrent Issues about things that need to be done several times.
Projects
None yet
Development

No branches or pull requests

1 participant