Mining Version Histories for Detecting Code Smells