One of the new Extended Event available in SQL Server 2022 is the query_antipattern.
This extended event allows to identify anti-patterns on the SQL queries
sent to the server. An anti-pattern in this case is some code that the
SQL Server optimizer can’t do a great job optimizing the code (but
cannot correct the issue automatically).