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

Feature. Auto-fixes for null-checks #681

Merged
merged 9 commits into from
Dec 31, 2020

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Dec 30, 2020

What's done:

  • Added fix tests
  • Added fix logic

This pull request closes #538

### What's done:
 * Added fix tests
 * Added fix logic
@aktsay6 aktsay6 added the enhancement New feature or request label Dec 30, 2020
@codecov
Copy link

codecov bot commented Dec 30, 2020

Codecov Report

Merging #681 (1d6de49) into master (565e2e9) will decrease coverage by 0.00%.
The diff coverage is 68.57%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #681      +/-   ##
============================================
- Coverage     80.00%   79.99%   -0.01%     
- Complexity     1824     1835      +11     
============================================
  Files            87       87              
  Lines          4735     4769      +34     
  Branches       1527     1540      +13     
============================================
+ Hits           3788     3815      +27     
+ Misses          239      238       -1     
- Partials        708      716       +8     
Flag Coverage Δ Complexity Δ
unittests 79.99% <68.57%> (-0.01%) 0.00 <10.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...in/org/cqfn/diktat/ruleset/rules/NullChecksRule.kt 72.09% <68.57%> (+0.93%) 33.00 <10.00> (+11.00)
...tat/ruleset/rules/classes/CompactInitialization.kt 78.78% <0.00%> (+3.03%) 17.00% <0.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 565e2e9...1d6de49. Read the comment docs.

### What's done:
 * Fixed bugs
@aktsay6 aktsay6 marked this pull request as ready for review December 30, 2020 14:53
### What's done:
 * Fixed bugs
"use 'requireNotNull' instead of require(${condition.text})"
) {
// todo implement fixer
val variableName = binaryExprNode.firstChildNode.text
Copy link
Member

Choose a reason for hiding this comment

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

Will firstChildNode always be the needed one here? Maybe, psi.getLeft() will be more reliable?

@aktsay6 aktsay6 merged commit ccfceb4 into master Dec 31, 2020
@aktsay6 aktsay6 deleted the feature/null-checks-autofixes(#538) branch December 31, 2020 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule 4.3.3: auto-fixes for null-checks
2 participants