It's pretty hard to unwind all this, but if you can, it then becomes pretty easy to analyze a table and describe what invalid data (anomalies) that table allows to be stored.
I did a RailsConf talk on this in 2019: https://www.youtube.com/watch?v=1VsSXRPEBo0