Created
September 30, 2023 08:23
-
-
Save drawers/4f1910116bc2efd62dceec9c871079d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun visit(root: KtFile) { | |
super.visit(root) | |
val classVisitor = UnusedClassVisitor() | |
root.accept(classVisitor) | |
classVisitor.privateClasses | |
.filterNot<KtNamedDeclaration> { it.isUsed() } | |
.forEach { | |
report(CodeSmell(issue, Entity.from(it), "Private class ${it.nameAsSafeName.identifier} is unused.")) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment