Group errors by the line that caused them, and sort them by frequency