-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Issue #16165: fix CyclomaticComplexity's switchBlockAsSingleDecisionPoint to properly handle switch blocks #16252
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
Conversation
Github, generate report for CyclomaticComplexity/all-examples-in-one |
Report for CyclomaticComplexity/all-examples-in-one: |
@nrmancuso @mahfouz72 please take a look at case |
@mohitsatr please propose a couple of solutions with examples, and provide your recommendation. |
Github, generate report for CyclomaticComplexity/all-examples-in-one |
Report for CyclomaticComplexity/all-examples-in-one: |
@nrmancuso Well, according to me there are only two possible solutions:
i went with second approach (for no particular reason). Second Approach:
but that raises the question: why not the first approach ? why are we even worrying about switch block inside a switch block. we can simply ignore everything inside the switch block. After all |
I vote for (1), @mahfouz72 @romani @rnveach what do you think? |
@mohitsatr , please proceed with |
4cca388
to
6c6c0ee
Compare
Github, generate report for CyclomaticComplexity/all-examples-in-one |
Report for CyclomaticComplexity/all-examples-in-one: |
@mohitsatr , please check jdk21 compilation . Remove wip from description. |
@romani have you gone through the regression report ? don't want to waste time if it's already reviewed by you. |
@mohitsatr , I am waiting explicit comment that PR is ready for review as it was in WIP for long, so please do all verifications on your side first. |
@romani this one is ready for review. on my part I checked all the files in report and Im pretty confident that change is working . I have not gone all in Openjdk. it is tiring. |
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.
items:
src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheck.java
Outdated
Show resolved
Hide resolved
…SingleDecisionPoint for nested switches
Github, generate report for CyclomaticComplexity/all-examples-in-one |
Report for CyclomaticComplexity/all-examples-in-one: |
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.
thanks a lot.
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.
Good stuff
resolves #16165