A big part of the clone detection code is functionality for filtering clones and clone groups based on different criteria. So far this filtering process is hard coded into the
CloneDetector which makes it hard to understand and extend.
To fix this, this patch implements a system of reusable constraints that are used to filter clones. The system is build upon the Constraint class and its subclasses which each filter one type of clones. To actually filter a set of clones, a list of constraints needs to be created and passed to the CloneDetector which apply them one after another on a list of CloneGroups.
This patch also migrates all previously hard coded constraints to the new system.