Find Compose state read/write issues

Proprietary

Patterns where a MutableState/State is read or constructed in a way that loses the snapshot value: explicit .value reads, bare mutableStateOf without remember, class-field state ownership, missing derivedStateOf, transient collection allocations.

org.openrewrite.kotlin.compose.FindComposeStateReadIssues$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.compose.FindComposeStateReadIssues$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 state.value reads inside a @Composable
  2. Find bare mutableStateOf(...) inside @Composable without remember { }
  3. Find mutableStateOf(...) stored in a class field
  4. Find remember { mutableStateOf(expensiveCall()) } patterns
  5. Find listOf(...) / mapOf(...) / setOf(...) calls inside a @Composable