Skip to content

Fix false negatives in UnreachableCode rule#3220

Merged
schalkms merged 2 commits into
detekt:masterfrom
t-kameyama:issue_3219
Nov 10, 2020
Merged

Fix false negatives in UnreachableCode rule#3220
schalkms merged 2 commits into
detekt:masterfrom
t-kameyama:issue_3219

Conversation

@t-kameyama

Copy link
Copy Markdown
Contributor

Fixes #3219

@codecov

codecov Bot commented Nov 9, 2020

Copy link
Copy Markdown

Codecov Report

Merging #3220 (42ed623) into master (54201cd) will increase coverage by 0.02%.
The diff coverage is 77.14%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3220      +/-   ##
============================================
+ Coverage     80.06%   80.09%   +0.02%     
- Complexity     2645     2647       +2     
============================================
  Files           440      440              
  Lines          8012     8012              
  Branches       1535     1531       -4     
============================================
+ Hits           6415     6417       +2     
  Misses          775      775              
+ Partials        822      820       -2     
Impacted Files Coverage Δ Complexity Δ
...h/detekt/core/baseline/IndentingXMLStreamWriter.kt 60.37% <ø> (ø) 15.00 <0.00> (ø)
...kt/generator/printer/rulesetpage/TestExclusions.kt 93.75% <ø> (ø) 4.00 <0.00> (ø)
...kotlin/io/gitlab/arturbosch/detekt/DetektPlugin.kt 82.53% <ø> (ø) 11.00 <0.00> (ø)
...urbosch/detekt/rules/performance/ArrayPrimitive.kt 70.37% <0.00%> (-3.71%) 17.00 <2.00> (+2.00) ⬇️
...lab/arturbosch/detekt/rules/style/UnusedImports.kt 85.91% <75.00%> (+0.62%) 4.00 <0.00> (ø)
...urbosch/detekt/rules/style/UselessCallOnNotNull.kt 83.78% <81.81%> (+7.31%) 17.00 <4.00> (+3.00)
...ab/arturbosch/detekt/rules/bugs/MissingWhenCase.kt 87.50% <100.00%> (-1.39%) 12.00 <3.00> (+1.00) ⬇️
...ab/arturbosch/detekt/rules/bugs/UnreachableCode.kt 100.00% <100.00%> (+7.69%) 5.00 <4.00> (-4.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 54201cd...c079192. Read the comment docs.

@schalkms schalkms left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for submitting this PR! The rule is now more sophisticated than ever before with the help of type and symbol solving. 🙂
Consequently, this change is breaking. We would need to add the require annotation to the rule comment.
Furthermore, the check for an empty bindingContext is missing in my opinion.

@t-kameyama t-kameyama requested a review from schalkms November 10, 2020 06:26
@schalkms schalkms merged commit 3f89553 into detekt:master Nov 10, 2020
@t-kameyama t-kameyama deleted the issue_3219 branch November 10, 2020 11:21
@arturbosch arturbosch added this to the 1.15.0 milestone Nov 10, 2020
arturbosch pushed a commit that referenced this pull request Dec 21, 2020
* Fix false negatives in UnreachableCode rule

* Add @requiresTypeResolution
arturbosch pushed a commit that referenced this pull request Jan 16, 2021
* Fix false negatives in UnreachableCode rule

* Add @requiresTypeResolution
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 negatives in UnreachableCode rule

4 participants