Update quality_specification.rb

Edited calculate_metrics method to be more concise.