The tyMeshRepair modifier can be used to fix many common topological issues present in meshes.
If any mesh degeneracies are detected during analysis, an analysis of face winding order/orientation will not occur, because the methods used to determine winding order can fail if mesh degeneracies are present.
Remove degenerate faces: when enabled, faces with invalid (out-of-range, duplicate or overlapping) vertex indices will be removed.
Remove zero-area faces: when enabled, faces with a zero (or near-zero) area will be removed.
Remove degenerate vertices: when enabled, vertices with invalid (NaN) coordinates will be removed.
Remove isolated vertices: when enabled, vertices not connected to any faces will be removed.
Remove degenerate maps: when enabled, maps with invalid face indices will be removed.
Remove explicit normals: when enabled, any explicit normals applied to the mesh will be removed.
Unify face winding order: when enabled, adjacent faces that have opposite winding order (clockwise vs counter-clockwise order of vertex indices) will be flipped to match each other. Since mesh normals are related to winding order, this should result in a unification of mesh normals across the surface.
For meshes with really terrible topology (edges with more than two adjacent faces connecting many elements, large numbers of adjacent faces with opposing winding order in localized groups, etc), it may seem as though “unify face winding order” will fail to properly fix winding order issues. However, a mesh that is irreparable is typically a mesh whose front and back faces exist in an ambiguous state, due to topological loops formed by groups of faces with a matching winding order being connected in multiple places to other faces with an opposing winding order. In these scenarios, the flood-fill algorithm used to correct winding order issues cannot resolve all those issues in a visually-consistent manner, and it will still be up to the artist to manually flip the winding order of remaining problem faces.
The surface unification algorithm uses a per-element raycasting approach to determine if a mesh is inside out. For elements in a mesh that are closed and not self-intersecting, this should have a 100% success rate. For more degenerate meshes (open, self-intersecting), the failure rate of this method can be higher.
A simple example of a mesh with a non-manifold element would be a mesh composed of two cubes that are connected along a single edge. The connection edge will have 4 adjacent faces, instead of 2.