Skip to content

Instantly share code, notes, and snippets.

@drawers
Created September 30, 2023 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drawers/4f1910116bc2efd62dceec9c871079d9 to your computer and use it in GitHub Desktop.
Save drawers/4f1910116bc2efd62dceec9c871079d9 to your computer and use it in GitHub Desktop.
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