Find java.io.File(...) allocations inside a @Composable body
ProprietaryFilesystem objects allocated inside a @Composable body get rebuilt on every recomposition. Even if the constructor is cheap, the I/O performed by callers (File.exists(), File.length()) often is not. Move the allocation into a remember { File(...) } block or out of the composable entirely.
org. openrewrite. kotlin. compose. FindSideEffectAllocationsInBody$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. compose. FindSideEffectAllocationsInBody$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.