A detailed analysis of the high energy gamma-ray emission from the Crab pulsar and nebula