Inspectopedia Help

Redundant qualifier name

Reports redundant qualifiers (or their parts) on class names, functions, and properties.

A fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to. In the contexts where the name can be shortened, the inspection informs on the opportunity and the associated 'Remove redundant qualifier name' quick-fix allows amending the code.

Examples:

package my.simple.name import kotlin.Int.Companion.MAX_VALUE class Foo fun main() { val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically }
package my.simple.name import kotlin.Int.Companion.MAX_VALUE class Foo fun main() { val a = Foo() val b = MAX_VALUE val c = Double.MAX_VALUE }

Inspection options

Here you can find the description of settings available for the Redundant qualifier name inspection, and the reference of their default values.

Unnecessary non-direct parent classes qualifiers

Not selected

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Kotlin, 241.14841-IJ

Last modified: 12 March 2024