The features provided by the Switch Off Violations plugin were added to SonarQube 4.0 and extended. Therefore, this plugin must not be used anymore with SonarQube 4.0+.

Description / Features

This plugin is used to exclude some issues in a fine-grained way. It allows to define some exclusion patterns to switch off issues:

Configuration

Exclusion patterns can be specified at both global and project levels. Go to Settings > Configuration > General Settings > Switch Off Violations (or at project level: Configuration > Settings > Switch Off Violations) and add exclusion patterns to the following properties:

Set the sonar.switchoffviolations.patterns property:

# Switch off all issues (Java projects: structure = packages)
*;*;*

# Exclude a specific rule
*;checkstyle:com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck;*

# Exclude on several ranges of lines
com.foo.Bar;*;[10-90,92,98,120-150]
 
# Exclude code blocks delimited by GEN-FIRST and GEN-LAST (like NetBeans auto-generated code)
GEN-FIRST;GEN-LAST
 
# Exclude files containing "@javax.annotation.Generated"
@javax\.annotation\.Generated

Usage

Run an analysis on your project to take into account your configuration.

Change Log