Why do we say 'there is no room to swing a cat'?

 

This refers to the whip called 'the cat', employed on early naval vessels, and not to the animal itself. The cat, or cat-o'-nine-tails (because it has nine separate knotted thongs), was too long to swing below decks. As a result, sailors condemned to be punished with a whipping had to be taken up above, where there was room to swing a cat.
The reason why the whip itself was called a cat was because it left scars on the backs of the whipped sailors reminiscent of the claw marks of a savage cat.