We studied the temporal evolution of the magnetic topology of the active region ( AR ) 11158 based on the reconstructed three-dimensional magnetic fields in the corona . The non-linear force-free field ( NLFFF )  extrapolation method was applied to the 12 minutes cadence data obtained with the Helioseismic and Magnetic Imager ( HMI ) onboard the Solar Dynamics Observatory ( SDO ) during five days . By calculating the squashing degree factor Q in the volume , the derived quasi-separatrix layers ( QSLs ) show that this AR has an overall topology , resulting from a magnetic quadrupole , including an hyperbolic flux tube ( HFT ) configuration which is relatively stable at the time scale of the flare ( \sim 1 - 2 hours ) . A strong QSL , which corresponds to some highly sheared arcades that might be related to the formation of a flux rope , is prominent just before the M6.6 and X2.2 flares , respectively . These facts indicate the close relationship between the strong QSL and the high flare productivity of AR 11158 . In addition , with a close inspection of the topology , we found a small-scale HFT which has an inverse tear-drop structure above the aforementioned QSL before the X2.2 flare . It indicates the existence of magnetic flux rope at this place . Even though a global configuration ( HFT ) is recognized in this AR , it turns out that the large-scale HFT only plays a secondary role during the eruption . In final , we dismiss a trigger based on the breakout model and highlight the central role of the flux rope in the related eruption .