Boolean literal argument without parameter name
Reports call arguments with Boolean
type without explicit parameter names specified.
When multiple boolean literals are passed sequentially, it's easy to forget parameter ordering that could lead to mistakes. Explicit parameter names allow for easier code reading and understanding.
Example:
fun check(checkName: Boolean, checkAddress: Boolean, checkPhone: Boolean) {}
fun usage() {
check(true, false, true) // What does this mean?
}
The quick-fix adds missing parameter names:
fun check(checkName: Boolean, checkAddress: Boolean, checkPhone: Boolean) {}
fun usage() {
check(checkName = true, checkAddress = false, checkPhone = true)
}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
BooleanLiteralArgument
Here you can find the description of settings available for the Boolean literal argument without parameter name inspection, and the reference of their default values.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Kotlin, 243.23126-IJ |
Thanks for your feedback!