Finding unused functions.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
open class Klass {
|
||||
fun used() {
|
||||
}
|
||||
}
|
||||
|
||||
class Subklass: Klass()
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
Subklass().used()
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
open class Klass {
|
||||
open fun used() {
|
||||
}
|
||||
}
|
||||
|
||||
class Subklass: Klass() {
|
||||
override fun used() {
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
Subklass().used()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Klass: Iterable<String> {
|
||||
override fun iterator(): Iterator<String> {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
Klass()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Klass {
|
||||
fun unused() {
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
Klass()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Klass {
|
||||
fun used() {
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
Klass().used()
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>topLevelUnused.kt</file>
|
||||
<line>1</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/topLevelUnused.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
||||
<description>Function 'unused' is never used</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>topLevelOnlyInImport.kt</file>
|
||||
<line>5</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/topLevelOnlyInImport.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
||||
<description>Function 'onlyInImport' is never used</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>local.kt</file>
|
||||
<line>2</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/local.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
||||
<description>Function 'local' is never used</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>local.kt</file>
|
||||
<line>1</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/local.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
||||
<description>Function 'outer' is never used</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>usedOnlyRecursively.kt</file>
|
||||
<line>1</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/usedOnlyRecursively.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
||||
<description>Function 'usedOnlyRecursively' is never used</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>classMemberUnused.kt</file>
|
||||
<line>2</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/classMemberUnused.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
||||
<description>Function 'unused' is never used</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
|
||||
@@ -0,0 +1,5 @@
|
||||
fun outer() {
|
||||
fun local() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
import foo.onlyInImport
|
||||
|
||||
fun onlyInImport() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun unused() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun used() {
|
||||
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
used()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun usedOnlyRecursively() {
|
||||
usedOnlyRecursively()
|
||||
}
|
||||
Reference in New Issue
Block a user