Find Spring Data / repository access smells

Proprietary

Repository call patterns that hide a problem: repo.findById(id).get() (use findByIdOrNull or getReferenceById) and findByIdOrNull(id!!) (contradictory nullability).

org.openrewrite.kotlin.spring.FindDataAccessSmells$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.spring.FindDataAccessSmells$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 repo.findById(id).get() chains
  2. Find findByIdOrNull(id!!) calls