-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Check for root of receiver in selector expression #7220
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7220 +/- ##
=======================================
Coverage ? 84.80%
Complexity ? 3998
=======================================
Files ? 577
Lines ? 12128
Branches ? 2485
=======================================
Hits ? 10285
Misses ? 616
Partials ? 1227 ☔ View full report in Codecov by Sentry. |
a5150ea
to
523f846
Compare
val descriptor = (expression.left as? KtNameReferenceExpression) | ||
?.getResolvedCall(bindingContext) | ||
?.resultingDescriptor |
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.
Why are you changing this?
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.
Same comment
With this rule, this code is started flagging. As we have written the code as
<expression>?.let { it.<someOtherNullableChain> }
that could be simplified as<expression>?.<someOtherNullableChain>
}?.getResolvedCall(bindingContext) | ||
?.resultingDescriptor | ||
?.fqNameOrNull() | ||
?.takeIf(mutableProperties::contains) | ||
?.let { candidateFqName -> | ||
// A candidate mutable property is present, so attach the current | ||
// if-expression to it in the property candidates map. | ||
candidateProperties.getOrPut(candidateFqName) { ArrayDeque() } | ||
.apply { add(expression) } | ||
} |
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.
Same as other comment. Looks like this change is unnecessary (let's move it to another PR?)
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.
With this rule, this code is started flagging. As we have written the code as <expression>?.let { it.<someOtherNullableChain> }
that could be simplified as <expression>?.<someOtherNullableChain>
detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryLet.kt
Outdated
Show resolved
Hide resolved
523f846
to
86a045c
Compare
Fixes #6373