The front rank issue pops up every so often. This previous question has an excellent thread on the matter, starting from u/Hergrim's answer, which should be top; while the question asks after Medieval combat, the factors at play are not substantially different.
There's also this post with answers from u/Iphikrates and u/Iguana_on_a_stick, which is more focused on Greek and Roman warfare.