Add metrics to count number of violations of each type.

This can be used in reports, or to compute other metrics (e.g. quality indicators...)