Find Flow operator antipatterns
ProprietaryFlow 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$KtRecipemod 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.
- Find
Flow.map { } .map { }chains - Find
Flow.filter { } .filter { }chains - Find
Flow.flowOnplaced after a terminal operator - Find
stateInwithSharingStarted.Eagerlyor unparameterized start - Find
shareIncalls without a timeout-parameterized start - Find
Flow.collectcalls inside a@Composable - Find
debounce(...).distinctUntilChanged()patterns - Find
flowOf(...)calls — verify size - Find
callbackFlow { }blocks without anawaitClose { }terminator