Preferably as small as possible really helps, I know from experience at Halo Mill. I'm quite short though, and a gun that length will most likely still be fine like Lozart said.
Any gun can be used in CQB, theres only a few instances where a short gun gives a massive advantage. If you're buying a gun for CQB, go for a short one, if you want to do CQB and have a longish gun already, you'll be fine.