Skip to content

Separating ComplexMethod rule into CyclomaticComplexMethod and CognitiveComplexMethod - #5442

Merged
BraisGabin merged 10 commits into
detekt:mainfrom
sanggggg:main
Oct 23, 2022
Merged

Separating ComplexMethod rule into CyclomaticComplexMethod and CognitiveComplexMethod#5442
BraisGabin merged 10 commits into
detekt:mainfrom
sanggggg:main

Conversation

@sanggggg

Copy link
Copy Markdown
Contributor

Fixes #5349

@github-actions github-actions Bot added the rules label Oct 19, 2022
@github-actions

github-actions Bot commented Oct 19, 2022

Copy link
Copy Markdown
Messages
📖 Thanks for adding a new rule to Detekt ❤️

Generated by 🚫 dangerJS against 2a0ae60

@BraisGabin

Copy link
Copy Markdown
Member

Did you create the PR to get early reviews or to get early CI checks? Or both? In other words, even the PR is a Draft, do you want me to review it or do you want to work a bir more and make CI happy first?

@sanggggg
sanggggg marked this pull request as ready for review October 19, 2022 14:09
@sanggggg

Copy link
Copy Markdown
Contributor Author

@BraisGabin Thank you for checking, I just opened it to get a review including your feedback.
(I opened it to receive an early review of the changes!)

@BraisGabin BraisGabin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Just two minor things and you need to make CI happy. I think that fixint the issues that I comment it will be happy but I'm not 100% sure because I don't fully understand why it is complaining.

* - __Nesting Level Increments__ - `if`, `when`, `for`, `while`, `do while`, `catch`, `nested function`
* - __Additional Complexity Increments by Nesting Level__ - `if`, `when`, `for`, `while`, `do while`, `catch`
*/
@ActiveByDefault(since = "1.22.0")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove this line. And probably run ./gradlew generateDocumentation because CI is complaining that the documentation is not on sync (probably detekt-core/src/main/resources/default-detekt-config.yml or detekt-core/src/main/resources/deprecation.properties)

That couls also fix the othere CI issues... I don't understand why this rule is executed...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing ActiveByDefault & sync config works fine 😄
2a0ae60

sanggggg and others added 2 commits October 20, 2022 10:03
…etekt/rules/complexity/CyclomaticComplexMethod.kt

Co-authored-by: Brais Gabín <braisgabin@gmail.com>

@BraisGabin BraisGabin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BraisGabin BraisGabin added this to the 1.22.0 milestone Oct 20, 2022
@BraisGabin

Copy link
Copy Markdown
Member

I just added the 1.22 milestone to this one. But I would know what others think about that. We are at RC2. Should we wait until the stable version to merge it?

@cortinico

cortinico commented Oct 21, 2022

Copy link
Copy Markdown
Member

I just added the 1.22 milestone to this one. But I would know what others think about that. We are at RC2. Should we wait until the stable version to merge it?

I think we might have a RC3 as we received several regressions in RC3 so it's probably also fine to merge this.

@BraisGabin
BraisGabin merged commit 7b632b2 into detekt:main Oct 23, 2022
@BraisGabin

Copy link
Copy Markdown
Member

I fully agree with a RC3. The number of contributions this month is great :) I imagine that hacktoberfest is working as a charm :)

antonis added a commit to wordpress-mobile/WordPress-Android that referenced this pull request Jul 18, 2023
antonis added a commit to wordpress-mobile/WordPress-Android that referenced this pull request Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the user to choose between cyclomatic and cognitive complexity in ComplexMethod rule

3 participants