The rule
Every fixture trap needs a vent close enough to do its job. The code measures that along the pipe, not in a straight line: from the trap weir to the inner edge of the vent opening. That's the developed length.
Table 1002.2 gives the maximum for each trap arm size: 30 inches for 1-1/4 inch, 42 for 1-1/2, 60 for 2, 72 for 3, and 120 for 4 inch. Above 4 inches, the minimum is two times the diameter and the maximum is still 120 inches. The vent can't be closer than two times the arm diameter, either.
Keep the arm sloped at 1/4 inch per foot. Water closets and similar fixtures follow a different limit: no more than 6 feet from the face of the closet flange to the inner edge of the vent. Horizontally wet vented tubs and showers are capped at 6 feet for 1-1/2 inch fixture drains and 8 feet for 2 inch drains, at the same slope.
On the job
- A kitchen sink with a 1-1/2 inch arm and a vent 4 feet away is over the limit. It's a common correction on remodels where the sink moves to a new wall.
- Measure along the pipe including fittings and bends, not as the crow flies.
- The table doesn't change for plastic versus cast iron. Size the arm for the fixture, then check the length.
The inspector and your city's adopted edition have the final word.