Weapons in the Call of Duty series are separated into five categories:submachine guns, shotguns, light machine guns, assault rifles, and snipers. Each category has its own specific niche.
Submachine guns are in the Call of Duty series pretty much the kings of close range combat. They have a high rate of fire, a medium mag size, and medium-high damage. The 100% mobility rate and quick ADS(aim down sight) time attribute to their success at close range. Their high recoil and weak bullet damage at long range make them suffer at close range.
Shotguns in the CoD series are far from their real life brothers. Shotguns in CoD usually have a relatively short range(only about 16 meters in Black Ops) This extremely short range plus the extremely slow rate of fire makes shotguns obsolete in most CoDs. Shotguns have an extremely low damage drop off, meaning the get extremely weak after around 10 meters. If you are looking to run and gun, use an SMG, it is much more effective, but shotguns can sometimes be more fun.(The only game I recommend using a shotgun in is MW2)
Light Machine Guns
LMGs have the slowest movement speed of all weapons in the CoD series. Players using an LMG will only be able to run 87.5% of the user using an SMG or shotgun. This decrease in movement speed is made up for by higher bullet damage and a larger clip(other than in Black Ops). Most LMGs have a slow RoF(Rate of Fire), which means they will lose must close range encounters. LMGs are good for holding a position, but not moving. I would not reccomend using them in Black Ops, but in most other CoDs they can hold their own.
Snipers have a high bullet damage, slow rate of fire and 95% movement speed. This class is very self explanatory, you can run and gun if you want to impersonate zzirGrizz, but if you want to get as many kills as possible, you will stay low and pick your shots.
Assault rifles are arguably that best and most effective weapon class in the past two CoDs(Black Ops/MW2). After World at War the assault rifles got a major makeover, they now do not have any idle sway(except for a few). Idle sway is the movement of your sights when aiming. This leads to less accurate shots and shorter range. if you have CoD4 aim down the sight with the ak47 and notice how your sight will move in a figure 8 pattern. This was erased in the most recent CoDs. This subtle change allows for Ars(Assault rifles) to dominate at nearly any range. Assault rifles can contend with SMGs at close range and Snipers at long range. Assault rifles have a medium clip, a medium rate of fire, a medium-fast reload, medium ADS, 95% movement speed, and a medium-high bullet damage. Assault rifles are the way to go for a truly balance gun in Black Ops and MW2.