Codimension and analytic spread