Find function-declaration smells
ProprietarySearch-only bundle: explicit : Unit / : Nothing return type, block bodies that are a single return expr, literal-Boolean-returning functions, Pair/Triple returns that could be data classes, default-before-required parameters, suspend fun declarations returning Job/Deferred, and explicit return Unit statements.
org. openrewrite. kotlin. bestpractices. FindFunctionDeclarationSmells$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. FindFunctionDeclarationSmells$KtRecipe'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Find functions with explicit
: Unitreturn type - Find functions declared with
: Nothingreturn type - Find
fun foo(): T { return x }block bodies - Find
fun f(): Boolean = true|falseliteral-returning functions - Find functions returning
Pair<A, B> - Find functions returning
Triple<A, B, C> - Find
suspend fundeclarations returningJob/Deferred - Find
return Unit/return kotlin.Unitstatements