while starting to implement the feature https://issues.apache.org/jira/browse/MCHECKSTYLE-356, I found out that a refactoring is needed.
The method int countViolations(Parser) does so many things besides counting violations. Some of them are:
- checking, if printing violations is wanted.
- actually printing violations
- counting violations
- counting ignored violations
- checking ignored violations count > 0 and logging
- Keeping track of file changes
I would like to rework this part of the code with no functional changes by creating a "Violation" value class.