Non-visible are legal - mostly because it would be so hard to enforce that its easier for them to just make it legal. Only stipulation is that you may not make the gun unsafe or disable a safety feature (ie, if an internal modification disables the thumb safety or makes it so that the gun would fire if dropped).
Replacement barrels in USPSA I know are allowed in production division but they must be the same length (within 0.1") and same chambering. IE, switching a Glock 22's barrel to a 9mm Lone Wolf conversion, even if same length, is illegal, but switching the G22's barrel to a .40S&W Lone Wolf would be fine as its the same chambering as the original. Also, no ports allowed on the barrel regardless.
IDPA SSP I'm a little less clear on, but I'm pretty sure the rules are roughly the same on barrels there.
Naturally outside of the stock-ish divisions (Production and SSP) you can do a little more with the barrel.
GSSF is a little more strict. Replacement barrels IIRC are generally not allowed except in their Unlimited class.
There are other exceptions too - pretty much all of them allow you to change sights (as long as they're "post and notch" type) even though that's an external modification.
Also, if you ever shoot a match under IPSC rules (international club that USPSA is an affiliate of), they have completely different rules for their production division. For the most part, internal modifications are specifically NOT allowed there, nor are any aftermarket barrels IIRC (they're REALLY strict
).