Deep inelastic scattering and its diffractive component, $ep to e^{prime}gamma^* p to e^{prime}XN$, have been studied at HERA with the ZEUS detector using an integrated luminosity of 52.4 pb$^{-1}$. The $M_X$ method has been used to extract the diffractive contribution. A wide range in the centre-of-mass energy $W$ (37 -- 245 GeV), photon virtuality $Q^2$ (20 -- 450 GeV$^2$) and mass $M_X$ (0.28 -- 35 GeV) is covered. The diffractive cross section for $2 < M_X < 15$ GeV rises strongly with $W$, the rise becoming steeper as $Q^2$ increases. The data are also presented in terms of the diffractive structure function, $F^{rm D(3)}_2$, of the proton. For fixed $Q^2$ and fixed $M_X$, $xpom F^{rm D(3)}_2$ shows a strong rise as $xpom to 0$, where $xpom$ is the fraction of the proton momentum carried by the Pomeron. For Bjorken-$x < 1 cdot 10^{-3}$, $xpom F^{rm D(3)}_2$ shows positive $log Q^2$ scaling violations, while for $x ge 5 cdot 10^{-3}$ negative scaling violations are observed. The diffractive structure function is compatible with being leading twist. The data show that Regge factorisation is broken.