Fix issues with Elvis operator in UnconditionalJumpStatementInLoop#4150
Merged
BraisGabin merged 1 commit intodetekt:mainfrom Oct 4, 2021
MiSikora:unconditional-jump
Merged
Fix issues with Elvis operator in UnconditionalJumpStatementInLoop#4150BraisGabin merged 1 commit intodetekt:mainfrom MiSikora:unconditional-jump
BraisGabin merged 1 commit intodetekt:mainfrom
MiSikora:unconditional-jump
Conversation
- Do not report break statements - Do not report conditional assignments - Don ot report conditional expressions
Codecov Report
@@ Coverage Diff @@
## main #4150 +/- ##
=========================================
Coverage 83.45% 83.45%
+ Complexity 3185 3181 -4
=========================================
Files 463 465 +2
Lines 9095 9104 +9
Branches 1768 1774 +6
=========================================
+ Hits 7590 7598 +8
- Misses 571 572 +1
Partials 934 934
Continue to review full report at Codecov.
|
picklebento
approved these changes
Oct 3, 2021
Member
picklebento
left a comment
There was a problem hiding this comment.
Thank you for fixing two bugs (The originally reported one for isConditionalJumpStatement() and the additional one for isFollowedByElvisJump())!
BraisGabin
approved these changes
Oct 4, 2021
Member
BraisGabin
left a comment
There was a problem hiding this comment.
👏👏👏 great refactor in the tests. It's way easier now. Great first contribution 👍.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was hard to determine which features I could break during development, so I split the tests into more granular ones.
I tried my best to cover the rule. Still, suppose anyone has ideas for adding more tests for false-positive or false-negative checks. In that case, I'll gladly add them as this rule is quite tricky, in my opinion: especially given nesting and such.
Closes #4134.