Find function-declaration smells

Proprietary

Search-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$KtRecipe
mod 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.

  1. Find functions with explicit : Unit return type
  2. Find functions declared with : Nothing return type
  3. Find fun foo(): T { return x } block bodies
  4. Find fun f(): Boolean = true|false literal-returning functions
  5. Find functions returning Pair<A, B>
  6. Find functions returning Triple<A, B, C>
  7. Find suspend fun declarations returning Job / Deferred
  8. Find return Unit / return kotlin.Unit statements