A parameter of a private function is never read

tx0/kotlin:unused-parameterstrictwarningmaintainability/dead-codedepth fastsmell

What it finds

A private function can be changed with all of its callers, so a parameter it ignores can go. Overrides, operators and annotated functions are left alone, as their signature is given, and so are parameters named _ or starting with unused. A parameter of a function type with a receiver counts as read where the body calls it on a receiver, as ext.block().

From the rule's source, unused_parameter.rs.

Example from the rule's tests
class Formatter {    private fun format(value: Int, width: Int): String = value.toString()tx0 reports: the parameter width is never read    fun public(value: Int, unusedHere: Int) = value    private fun ignored(_unusedFlag: Boolean, unusedSize: Int) = 1    override fun toString() = format(1, 2) + ignored(true, 1)} private fun Project.android(block: AndroidExtension.() -> Unit) {    val ext = extensions.getByType(AndroidExtension::class.java)    ext.block()}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/kotlin:unused-parameter" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/kotlin:unused-parameter] reason="..."

tx0 explain tx0/kotlin:unused-parameter shows the same in the terminal. Found a false positive? Report it.