Skip to content
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

Refactor UnsafeCallOnNullableType rule #3221

Merged

Conversation

t-kameyama
Copy link
Contributor

  • Check KtPostfixExpression instead of KtUnaryExpression
    • We don't need to check KtPrefixExpression
  • Check nullability after checking if operation is '!!'
    • We don't need to check nullability if operation is not '!!'

@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #3221 (1223d2f) into master (54201cd) will increase coverage by 0.02%.
The diff coverage is 50.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3221      +/-   ##
============================================
+ Coverage     80.06%   80.09%   +0.02%     
- Complexity     2645     2651       +6     
============================================
  Files           440      440              
  Lines          8012     8013       +1     
  Branches       1535     1529       -6     
============================================
+ Hits           6415     6418       +3     
  Misses          775      775              
+ Partials        822      820       -2     
Impacted Files Coverage Δ Complexity Δ
...osch/detekt/rules/bugs/UnsafeCallOnNullableType.kt 77.77% <50.00%> (+5.05%) 4.00 <2.00> (ø)
...urbosch/detekt/rules/performance/ArrayPrimitive.kt 70.37% <0.00%> (-3.71%) 17.00% <0.00%> (+2.00%) ⬇️
...ab/arturbosch/detekt/rules/bugs/MissingWhenCase.kt 87.50% <0.00%> (-1.39%) 12.00% <0.00%> (+1.00%) ⬇️
...kotlin/io/gitlab/arturbosch/detekt/DetektPlugin.kt 82.53% <0.00%> (ø) 11.00% <0.00%> (ø%)
...h/detekt/core/baseline/IndentingXMLStreamWriter.kt 60.37% <0.00%> (ø) 15.00% <0.00%> (ø%)
...lab/arturbosch/detekt/rules/style/UnusedImports.kt 85.91% <0.00%> (+0.62%) 4.00% <0.00%> (ø%)
...urbosch/detekt/rules/style/UselessCallOnNotNull.kt 83.78% <0.00%> (+7.31%) 17.00% <0.00%> (+3.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...1223d2f. Read the comment docs.

@schalkms schalkms merged commit cfde886 into detekt:master Nov 10, 2020
@t-kameyama t-kameyama deleted the refactor_UnsafeCallOnNullableType branch November 10, 2020 11:22
@arturbosch arturbosch added this to the 1.15.0 milestone Nov 10, 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.

None yet

4 participants