-
Notifications
You must be signed in to change notification settings - Fork 39
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
Bugfix of NPE in complex binary expressions in long line rule #983
Conversation
Codecov Report
@@ Coverage Diff @@
## master #983 +/- ##
=========================================
Coverage 83.81% 83.81%
- Complexity 2407 2409 +2
=========================================
Files 102 102
Lines 6079 6081 +2
Branches 1797 1799 +2
=========================================
+ Hits 5095 5097 +2
Misses 269 269
Partials 715 715
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Despite the fact, that for now we get rid of NPE and cover this case by tests, we still have issue on related functionality #984 I think, we can consider it in future PR |
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Outdated
Show resolved
Hide resolved
if (it.elementType == REFERENCE_EXPRESSION && it.treeParent.elementType == CALL_EXPRESSION) { | ||
binList.add(it.treeParent) | ||
if (it.elementType == REFERENCE_EXPRESSION && it.treeParent?.elementType == CALL_EXPRESSION) { | ||
binList.tryAdd(it.treeParent) |
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.
Did we add the same element multiple times here? How could it be?
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.
Yeah, thanks, I did a lot of experiments with dfsForProperty
and it's remain from them, now it's not necessary, removed.
What's done:
binList
could hold incorrect nodes, which had nobinary expression
as first common parent