My intuition tells me that moving duplicate/common codes among subclasses to the superclass (so superclass now have a new method) is a bad idea, but I have seen this technique used/described in both Design Pattern and Refactoring(e.g. pull up method) books. After some thinking my idea is that now subclasses' behavior is coupled to the superclass, and this will make someone who need to maintain the code to read the entire inheritance structure/tree to understand the logic in a subclass, if the hierarchy is large then it's hard to maintain it. Any advice?
You'll find a lot of resistance to large and/or deep class hierarchies, so I'm not suggesting that. However,
Let's say you have three subclasses (S1,S2,S2), but only two of which (S1,S2) have common/duplicated behavior. Because of the third class (S3), which doesn't share the common behavior, it is, in this case, not appropriate to pull methods up directly into the base class. An alternative, then, is to introduce an intermediate subclass (B12) of the base, that the others (S1,S2) use for their base (leaving S3 alone). Then pull up common subclass behaviors into that intermediate subclass. This will avoid polluting the original base class with respect to the other subclasses (like S1).
Note that in languages with differentiation between interfaces and base/sub-classes, this can also be accomplished with interfaces — here one interface extends another — some concrete classes then implement the various interfaces as needed. This offers the looser coupled of interfaces, while allowing that some are more specialized that the most general.
my idea is that now subclasses' behavior is coupled to the superclass
A subclasses behavior is always coupled to the superclass
this will make someone who need to maintain the code to read the entire inheritance structure/tree to understand the logic in a subclass
They will have always have to do that anyway.
if the hierarchy is large then it's hard to maintain it
That's why you shouldn't have large inheritance hierarchies, and prefer composition over inheritance in general.