According to what I’ve heard, a longer barrel does increase damage, but not linearly.
Imagine a cannon, with its relatively long barrel. Remove the entire barrel and just put the cannonball on a wall as gunpowder is exploded. Or even just shorten the barrel so it all BARELY fits.
To a certain point, longer barrels are better (if unwieldy).