According to the Cody Family Association records you line runs thus:
Philip and Martha Les Caude of Beverly, MA had several sons. Among them were Isaac and Joseph.
Isaac b. 1703 married Hannah Carryl and they had a son Joseph
Joseph b. 1736 married Mary Parmenter and they had a son Joseph
Joseph b. 1769 married Katherine Kane and they had a son David
David b. 1797 married Susan Spaulding Sutton and they had a son David Barney
(Susan was a second wife, thus the huge age gap between David and his son David)
David Barney b. 1863 m. Effie Lily Farley and they had a son David Arlet
David Arlet b. 1889 married Isabelle Bessie Postel and they had a son Ivan Dale
Ivan Dale b. 1923 married Gladys Mae Trackwell and you know the rest.
Another of Philip and Martha's sons was Joseph.
Joseph had a son Joseph
Joseph had a son Philp
Philip had a son Philip
Philip had a son Isaac
Isaac had a son William Frederick (Buffalo Bill)
So it would appear that your great grandfather David Arlet Cody was a fifth cousin to Buffalo Bill. That would make Buffalo Bill your fifth cousin three times removed.
If you want more details contact the Cody Family Association (google them).
They'd be happy to hear from you.