Unused parameters should be removedKT-W1061
When defining a function, it is common to encounter scenarios where a parameter is declared but not actually used within the function body. In such cases, it is considered good practice to remove the unused parameter to simplify the function signature. By removing the unused parameter, you make the function declaration cleaner and easier to read, and it also communicates to other developers that the parameter is not relevant to the function's logic.
It's important to note that removing unused parameters should be done with care. Before removing a parameter, make sure it is truly unnecessary and won't be needed in the future. Consider factors such as code maintainability, potential future requirements, and the impact on other parts of the codebase.
Bad Practice
fun foo(unused: String) {
// implementation
}
Recommended
Remove the unused parameters from the function signature.
fun foo() {
// implementation
}