Find Flow operator antipatterns

Proprietary

Flow chains where operator order, sharing configuration, or terminal placement undermines the intended behavior — collapsible map.map / filter.filter, flowOn past a terminal, stateIn/shareIn without an explicit timeout, Flow.collect inside @Composable, etc.

org.openrewrite.kotlin.coroutines.FindFlowAntiPatterns$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.coroutines.FindFlowAntiPatterns$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 Flow.map { } .map { } chains
  2. Find Flow.filter { } .filter { } chains
  3. Find Flow.flowOn placed after a terminal operator
  4. Find stateIn with SharingStarted.Eagerly or unparameterized start
  5. Find shareIn calls without a timeout-parameterized start
  6. Find Flow.collect calls inside a @Composable
  7. Find debounce(...).distinctUntilChanged() patterns
  8. Find flowOf(...) calls — verify size
  9. Find callbackFlow { } blocks without an awaitClose { } terminator