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

Skip to content

Conversation

@t-kameyama
Copy link
Contributor

@t-kameyama t-kameyama commented Mar 12, 2022

Fixes #4626

@codecov
Copy link

codecov bot commented Mar 12, 2022

Codecov Report

Merging #4628 (53bb7a7) into main (ea6737f) will increase coverage by 84.52%.
The diff coverage is 64.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #4628       +/-   ##
===========================================
+ Coverage        0   84.52%   +84.52%     
- Complexity      0     3358     +3358     
===========================================
  Files           0      481      +481     
  Lines           0    11193    +11193     
  Branches        0     2042     +2042     
===========================================
+ Hits            0     9461     +9461     
- Misses          0      698      +698     
- Partials        0     1034     +1034     
Impacted Files Coverage Δ
...sch/detekt/rules/style/UnnecessaryAbstractClass.kt 79.16% <64.00%> (ø)
...lin/io/github/detekt/tooling/api/spec/RulesSpec.kt 100.00% <0.00%> (ø)
...itlab/arturbosch/detekt/api/internal/Signatures.kt 85.71% <0.00%> (ø)
...n/io/github/detekt/metrics/CyclomaticComplexity.kt 95.31% <0.00%> (ø)
...github/detekt/tooling/dsl/ProcessingSpecBuilder.kt 100.00% <0.00%> (ø)
...arturbosch/detekt/generator/printer/RulePrinter.kt 100.00% <0.00%> (ø)
...bosch/detekt/generator/collection/DefaultValues.kt 90.00% <0.00%> (ø)
...sch/detekt/formatting/wrappers/NoMultipleSpaces.kt 100.00% <0.00%> (ø)
...osch/detekt/core/tooling/DefaultVersionProvider.kt 50.00% <0.00%> (ø)
...n/kotlin/io/gitlab/arturbosch/detekt/api/Entity.kt 75.00% <0.00%> (ø)
... and 472 more

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 ea6737f...53bb7a7. Read the comment docs.

@cortinico cortinico added this to the 1.20.0 milestone Mar 12, 2022
Comment on lines +87 to +97
val (abstractMembers, concreteMembers) = members.partition { it.isAbstract() }
if (abstractMembers.isEmpty() && !hasInheritedMember(true)) {
report(CodeSmell(issue, Entity.from(this), noAbstractMember))
return
}
if (abstractMembers.any { it.isInternal() || it.isProtected() } || hasConstructorParameter()) {
return
}
if (concreteMembers.isEmpty() && !hasInheritedMember(false)) {
report(CodeSmell(issue, Entity.from(this), noConcreteMember))
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: The previous detectAbstractAndConcreteType() seems cleaner to me.

Comment on lines +106 to +107
private fun KtClass.members() = body?.children?.filterIsInstance<KtCallableDeclaration>().orEmpty() +
primaryConstructor?.valueParameters?.filter { it.hasValOrVar() }.orEmpty()
Copy link
Member

Choose a reason for hiding this comment

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

For future readers: This line of change is the fix.

@chao2zhang chao2zhang merged commit 7740a2a into detekt:main Mar 12, 2022
@t-kameyama t-kameyama deleted the issue_4626 branch March 12, 2022 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnnecessaryAbstractClass does not consider unimplemented base properties

4 participants