Manual action centerfire (rifles and shotguns) can have any length barrel, as long as the OAL is 26" or greater and remain non-restricted.
Semi-auto centerfire (rifle or shotgun) must have an 18.5" or longer barrel to remain non-restricted as well as an OAL of 26" or more.
If you use a folding/collapsing stock, the OAL must remain over 26" in the shortest firing configuration in order to remain non-restricted.
A barrel can be cut to 18", but no shorter. If you want it shorter, it must have been manufactured at that length.
Mark