The biggest worry about a broken rib, as mentioned above, is a punctured lung.
Punctured lungs at the surface are a moderate problem, causing shortness of breath, pain and (in the case of tension pneumothorax) can be life threatening.
At depth, when a lung is punctured and collapses, some of the air you are breathing leaks into the space around the lung called the pleural cavity. This is called a pneumothorax.
If you are at 3 Atmospheres absolute (around 68 ft seawater) and rise to the surface, that trapped air expands to three times its volume at depth. Thus a small leak at depth can be an enormous problem and is extremely dangerous.
A pneumothorax is an absolute contraindication to diving and a history of collapsed lung is enough of a worry that someone with previous collapse should get clearance from a diving doc before returning to diving.
Diving with a "cracked" rib is therefore somewhat dangerous, and the specifics of your case and your risks should be evaluated by you and a doc familiar with diving.
The other risk (true with any painful injury) is that with a very painful rib cage, your ability to respond to an in-water emergency with increased effort may be seriously impaired, and you may be unable to rescue yourself or your buddy if something bad happens.
Murphy's law states that if something bad can happen. it probably will.
The first corollary of Murphy's law is that when something bad happens, it usually occurs at the worst possible time.
Dive safe.. let the bubbles be in the water column and not in your rib cage.
John