Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@t-kameyama
Copy link
Contributor

Fixes #2452

@codecov
Copy link

codecov bot commented Jul 22, 2020

Codecov Report

Merging #2886 into master will decrease coverage by 0.00%.
The diff coverage is 76.47%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2886      +/-   ##
============================================
- Coverage     80.19%   80.19%   -0.01%     
- Complexity     2413     2425      +12     
============================================
  Files           421      421              
  Lines          7353     7368      +15     
  Branches       1341     1349       +8     
============================================
+ Hits           5897     5909      +12     
- Misses          760      761       +1     
- Partials        696      698       +2     
Impacted Files Coverage Δ Complexity Δ
...rbosch/detekt/rules/style/optional/OptionalUnit.kt 79.54% <76.47%> (+0.23%) 26.00 <15.00> (+12.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b24851d...d387ed4. Read the comment docs.

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

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

Good job! I really like all the corner cases that you covered in the tests 👏🏻👏🏻

.filter { it is KtNameReferenceExpression && it.text == UNIT }
val statements = expression.statements
val lastStatement = statements.lastOrNull() ?: return
statements
Copy link
Member

Choose a reason for hiding this comment

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

Couls these if/return be replaced with an if/else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've replaced these with 'when' expression.

@t-kameyama t-kameyama requested a review from BraisGabin July 22, 2020 10:02
@schalkms schalkms merged commit c1cf9d7 into detekt:master Jul 22, 2020
@t-kameyama t-kameyama deleted the issue_2452 branch July 22, 2020 22:04
@arturbosch arturbosch added this to the 1.10.1 milestone Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive in OptionalUnit rule

4 participants