I saw the description for the upcoming 'switch off violations' plugin (http://docs.codehaus.org/display/SONAR/Switch+Off+Violations+Plugin). It would be nice to have a dynamic way of excluding files or suppress violations based on file content.
We have several projects containing a lot of generated code which we would like to exclude from analysis. Since the code is generated from models, "static" exclude patterns with given package or file patterns are not helpful: file and package names can change from release to release for a given project / file and package names are different from project to project using the generator. It would be therefore nice to be able to specify a "content marker" instead of a file / package name pattern to exclude a file (e. g. exclude file from analysis if it contains '@generated' in the header).
I'm not sure if this should be a feature for sonar itself or for the "switch off violations plugin". As far as I understand, the purpose of the 'switch off plugin' is the suppression of violations. However, in our case, excluding files altogether effectively removing them from any metric would be preferable.