-
-
Notifications
You must be signed in to change notification settings - Fork 768
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
Calculate MCC (McCabe Complexity) accordingly #1921
Comments
Thanks for tackling this. I suggest to get all points implemented before shipping this if you are okay with it. |
The refactoring of |
I mean this rule is a breaking change/bug fix/improvement and we should ship it in a new minor version when all 6 bullet points are ready. |
arturbosch
added a commit
that referenced
this issue
Nov 16, 2019
arturbosch
added a commit
that referenced
this issue
Nov 16, 2019
arturbosch
added a commit
that referenced
this issue
Nov 16, 2019
…n ndepend's implementation of cyclomatic complexity - #1921
arturbosch
added a commit
that referenced
this issue
Nov 16, 2019
Merged
arturbosch
added a commit
that referenced
this issue
Nov 19, 2019
* Simplify cyclomatic complexity visitor logic - #1921 * Support couting ?:, &&, ||, continue and break expressions - #1921 * Update documentation and increase threshold for ComplexMethod based on ndepend's implementation of cyclomatic complexity - #1921 * Make nesting functions configurable - #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
smyachenkov
pushed a commit
to smyachenkov/detekt
that referenced
this issue
Dec 9, 2019
* 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
smyachenkov
pushed a commit
to smyachenkov/detekt
that referenced
this issue
Dec 9, 2019
* 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Your feature request may already be reported!
Please search in the issues before creating a new one.
Expected Behavior
The cyclomatic complexity should be calculated with reference to the control flow graph of the program.
Current Behavior
Some statements that introduce are new path are still not counted.
Context
cases/ComplexClass.kt
!!?:
&&
and||
not only in if statements but rather in every binary-expressionbreak
/continue
)throw
safe call operator?.
(can only be accurately calculated using Java byte code)reference #1793
The text was updated successfully, but these errors were encountered: