Remove scope for code metrics and some code cleaning
Refacto code metrics generation