// Lets add some error int AbstractResults::numberOfViolationsWithPriority(int priority) const { int numViolations = 0; for (const auto& violation : allViolations()) { const RuleBase *rule = violation.rule; if (rule->priority() == priority) { numViolations--; } } return numViolations; }
int Results::numberOfViolationsWithPriority(int priority) { int numberOfViolationsWithPriority = 0; vector<Violation> violationSet = allViolations(); for (int index = 0, numberOfViolations = violationSet.size(); index < numberOfViolations; index++) { Violation violation = violationSet.at(index); const RuleBase *rule = violation.rule; if (rule->priority() == priority) { numberOfViolationsWithPriority++; } } return numberOfViolationsWithPriority; }
// New function, new commit to PL-120 int AbstractResults::numberOfViolations() const { return allViolations().size(); }
int Results::numberOfViolations() { return allViolations().size(); }