They moved the main breaker panel and this is the rats nest left behind in the old panel. What a mess.
Ouch!
The Flying romex wouldn’t be compliant since its subject to physical damage.
Yes that’s a mess, but with some cleaning up it might become code compliant.