  In this paper we develop a general `analytic' splitting principle for RCD
spaces: we show that if there is a function with suitable Laplacian and
Hessian, then the space is (isomorphic to) a warped product. Our result covers
most of the splitting-like results currently available in the literature about
RCD spaces. We then apply it to extend to the non-smooth category some
structural property of Riemannian manifolds obtained by Li and Wang.
