[JENKINS-17247] Refactored a bit to extract the SCC computation into a reusable code