Bent rear derailleur (RD-5701)? I was cleaning the chain on my CX bike today, and while cleaning the rear derailleur I noticed the following:
When moving the cage from one extreme to another, the cage body will rub against the derailleur (main?) body at one point somewhere around the middle point of its movement range. 

Please see the linked video which will hopefully clarify my explanation:
VIDEO

I don't think this is normal so I guess I would like a confirmation whether the derailleur is bent or not, or there is some other problem. It is a relatively new Shimano RD-5701 middle cage derailleur which has possibly received one abnormal knock when I was putting the bike into the trunk of my car. 

The shifting is functioning pretty much OK except some difficulties at the two smallest cogs (I am using a 11-32 cassette), which I think are at least partly caused by improper adjustment of the derailleur and cabling, as the whole set is quite new so the cables and housing are definitely not yet worn in, but maybe this rubbing can be another cause?

I would be very grateful for any comments or suggestions.
I don't see any chain in the video.  It (most) will do that with no chain. The spring is (hopefully) strong enough to pull an untethered derailleur into the cassette.
Park Chain Length Sizing

Now the derailleur may also be bent but that is something different.

The rubbing in that video is only a problem if it rubs with the chain installed.