Looking for way to find self-intersecting quads in any 3D software

Sometimes after automated retopo of organic meshes you can find self-intersecting quad faces.
Antiparallelogram - Wikipedia - good wiki example.
Its really hard to manually search and fix such sort of faces, especially on heavy meshes.

Internal software fixing tools doesn’t works (Maya, Blender, 3dsMax), at least I didn’t find any working tool.

Maybe something like:

for each quad in mesh:
  for each other quad within a distance threshold:
    get dot products of each (vertex in 2nd quad) and normal of first quad
    if all dot products arent either all pos or all neg, then theres a potential intersection

If a face has two edges with the same center (v1+v2)/2, you spotted your problem.

You can use ray tracing to do this. Are you familiar with linear algebra and the plane equation? Pm me if this dosent sound familiar