-
-
Notifications
You must be signed in to change notification settings - Fork 773
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
Refactor ComplexMethod #2090
Refactor ComplexMethod #2090
Conversation
…n ndepend's implementation of cyclomatic complexity - #1921
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I particularly like the config implementation for the CyclomaticComplexity class.
TIL that you can now use Kotlin functions inside Spec's context()
functions. Cool!
As I commented, the ComplexMethod
case file is very hard to understand and maintain.
Hopefully, we can also approach at some point in the future.
For now, this PR looks very fine! 👍
detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt
Show resolved
Hide resolved
detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt
Outdated
Show resolved
Hide resolved
detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/CyclomaticComplexity.kt
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2090 +/- ##
============================================
+ Coverage 80.84% 80.95% +0.11%
- Complexity 2008 2020 +12
============================================
Files 336 336
Lines 5784 5813 +29
Branches 1059 1058 -1
============================================
+ Hits 4676 4706 +30
Misses 546 546
+ Partials 562 561 -1
Continue to review full report at Codecov.
|
…/complexity/ComplexMethod.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com>
…/complexity/ComplexMethod.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com>
…ernal/CyclomaticComplexity.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com>
Thanks! I've refactored some test cases and removed that ComplexMethod case file :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
11b8af9
to
15fff9b
Compare
* Simplify cyclomatic complexity visitor logic - detekt#1921 * Support couting ?:, &&, ||, continue and break expressions - detekt#1921 * Update documentation and increase threshold for ComplexMethod based on ndepend's implementation of cyclomatic complexity - detekt#1921 * Make nesting functions configurable - detekt#1921 * Split ComplexMethod test case to many simpler test cases * Update detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com> * Update detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com> * Update detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/CyclomaticComplexity.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com> * Remove semicolon from split delimiters
* Simplify cyclomatic complexity visitor logic - detekt#1921 * Support couting ?:, &&, ||, continue and break expressions - detekt#1921 * Update documentation and increase threshold for ComplexMethod based on ndepend's implementation of cyclomatic complexity - detekt#1921 * Make nesting functions configurable - detekt#1921 * Split ComplexMethod test case to many simpler test cases * Update detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com> * Update detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com> * Update detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/CyclomaticComplexity.kt Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com> * Remove semicolon from split delimiters
Now considers
if
orfor
are now configurableCloses #1921