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

Rule 5.2.3 Use default values for function arguments instead of overloading them #370

Merged
merged 9 commits into from
Oct 13, 2020

Conversation

kentr0w
Copy link
Collaborator

@kentr0w kentr0w commented Oct 6, 2020

What's done:

Implemented rule

Actions checklist

### What's done:
    Implemented rule
@kentr0w kentr0w added the enhancement New feature or request label Oct 6, 2020
@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

Merging #370 into master will increase coverage by 0.09%.
The diff coverage is 94.11%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #370      +/-   ##
============================================
+ Coverage     83.09%   83.18%   +0.09%     
- Complexity     1289     1295       +6     
============================================
  Files            64       65       +1     
  Lines          3147     3164      +17     
  Branches        999     1004       +5     
============================================
+ Hits           2615     2632      +17     
  Misses          168      168              
  Partials        364      364              
Flag Coverage Δ Complexity Δ
#unittests 83.18% <94.11%> (+0.09%) 1295.00 <6.00> (+6.00)

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

Impacted Files Coverage Δ Complexity Δ
...at-rules/src/main/kotlin/generated/WarningNames.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...ktat/ruleset/rules/OverloadingArgumentsFunction.kt 93.33% <93.33%> (ø) 6.00 <6.00> (?)
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 97.08% <100.00%> (+0.02%) 9.00 <0.00> (ø)
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 98.11% <100.00%> (+0.03%) 3.00 <0.00> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 83.24% <0.00%> (+0.50%) 0.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 d88c1ba...88e6785. Read the comment docs.

### What's done:
    Fixed bugs after review
…-function-default-values

# Conflicts:
#	diktat-analysis.yml
#	diktat-rules/src/main/kotlin/generated/WarningNames.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/constants/Warnings.kt
#	diktat-rules/src/main/resources/diktat-analysis-huawei.yml
#	diktat-rules/src/main/resources/diktat-analysis.yml
#	info/available-rules.md
@kentr0w kentr0w requested a review from petertrr October 7, 2020 11:23
### What's done:
   Fixed bug after review
…-function-default-values

# Conflicts:
#	diktat-rules/src/main/kotlin/generated/WarningNames.kt
#	diktat-rules/src/main/resources/diktat-analysis-huawei.yml
@petertrr petertrr changed the title Rule 5.2.3 Rule 5.2.3 Use default values for function arguments instead of overloading them Oct 8, 2020
Copy link
Member

@petertrr petertrr left a comment

Choose a reason for hiding this comment

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

I just noticed that isComparisonWithAbs in AccurateCalculationsRule is detected by your rule, though there are extensions on different class with same name. You should also compare receiver type if it is present along with function names.

### What's done:
  Fixed final bug
### What's done:
   Fixed bug after review
…-function-default-values

# Conflicts:
#	diktat-analysis.yml
#	diktat-rules/src/main/kotlin/generated/WarningNames.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/constants/Warnings.kt
#	diktat-rules/src/main/resources/diktat-analysis-huawei.yml
#	diktat-rules/src/main/resources/diktat-analysis.yml
#	info/available-rules.md
### What's done:
   Fixed bug after review
Copy link
Collaborator

@aktsay6 aktsay6 left a comment

Choose a reason for hiding this comment

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

lgtm

@kentr0w kentr0w merged commit 5eca888 into master Oct 13, 2020
@kentr0w kentr0w deleted the feature/overloading-function-default-values branch October 13, 2020 08:50
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 5.2.3 Use default values for function arguments instead of overloading them
3 participants