Find Compose Modifier ordering smells

Proprietary

Modifier chains whose order produces a subtly wrong visual or interactive shape: clickable painted over by a later background, fillMaxWidth followed by padding (inset after the fill), and fillMaxSize immediately followed by a redundant fillMaxWidth/fillMaxHeight. Also surfaces Modifier.weight(...) calls outside a Row/Column scope, and overly long chains that could be hoisted into a named modifier.

org.openrewrite.kotlin.compose.FindModifierOrderingSmells$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.compose.FindModifierOrderingSmells$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 Modifier.clickable { }.background(...) chains
  2. Find Modifier.fillMaxWidth().padding(...) chains
  3. Find Modifier.fillMaxSize().fillMaxWidth() chains
  4. Find Modifier.weight(...) calls outside a Row/Column scope
  5. Find Modifier.xxx().yyy()... chains longer than five operations