Your most unhappy customers are your greatest source of learning.

Switchoff plugin for sonar

Guys

Have you ever been tried to use switch off plugin of sonar ?

This plugin is really helpful when you switch-off any specific violation from the specific line or specific files.
I really liked this plugin.

See below details to get it installed :



1) Start sonar and login with admin credentials
2) Go Configuration >> Update Center and click on Available plugins tab and install LDAP plugin
3) Search for switchoff plugin and install it
4) Restart sonar server now
5) Again login with admin credentials and click on specific project for which you want to switch off some violations
6) Now got o Settings >> switch off violcations link given in left hand side (See screnshot)



7) Here you call apply your filter for which violation you wan to apply.

The configuration of the plugin is done in the Web admin console, where you can specify the exclusion patterns in the textarea (one per line):
  • Comments start with #
  • Blank lines are allowed
  • A line defines 3 fields: resource key, rule key and range of lines.
Example:
# suppress all violations
*;*;*

# exclude the Java file com.foo.Bar
com.foo.Bar;*;*

# exclude a Java package
com.foo.*;*;*

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

# exclude a specific rule on a specific file
com.foo.Bar;checkstyle:com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck;*

# exclude on specific lines 10, 25 and 90
com.foo.Bar;*;[10,25,90]

# exclude on a range of lines
com.foo.Bar;*;[10-90]

# exclude on many ranges of lines
com.foo.Bar;*;[10-90,92,98,120-150]

No comments:

Post a Comment

Most Reading

 

Like Me & Share

Buy Websites PRchecker.info

Members

Ranks