{jenkins-plugin-info:pluginId=violations}

This plug-in generates reports static code violation detectors such as checkstyle, pmd, cpd, findbugs, codenarc, fxcop, stylecop and simian.




This plugin is no longer maintained, you may want to use the Warnings Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Warnings+Plugin

Note: Since version 0.6.0 the violations plugin works with the jenkins maven2 project type..

Description

The violations plug-in scans for violation xml files of particular types in the build workspace, gathers the violations and reports on the numbers for each type. The currently supported types are:

type

url

version

maintainer

notes

checkstyle

http://checkstyle.sourceforge.net/

4.2

 

 

pmd

http://pmd.sourceforge.net

4.0

 

 

cpd

http://pmd.sourceforge.net/cpd.html

4.0

 

 

findbugs

http://findbugs.sourceforge.net/

1.3.3rc2

 

There are some issues with the maven plugin of findbugs - one needs to set the sourcepath field and it also appears that some violations are reported against incorrect files.

 

http://fb-contrib.sourceforge.net/

3.4.2

 

A findbugs plugin

pylint

http://www.logilab.org/857

 

redsolo

 

fxcop

http://blogs.msdn.com/fxcop/

1.35+

redsolo

 

stylecop

http://code.msdn.microsoft.com/sourceanalysis

4.2+

redsolo

 

simian

http://www.redhillconsulting.com.au/products/simian/

 

redsolo

 

gendarme

http://mono-project.com/Gendarme

 

 

 

jslint

http://www.jslint.com/lint.html


 

 

jcreport

http://www.jcoderz.org/fawkez/wiki/JcReport


 

 

pep8

https://github.com/jcrocholl/pep8

 

 

ok

codenarc

http://codenarc.sourceforge.net

 

 

 

perlcritic

http://perlcritic.com/

 

 

 

Configuration

Note: the following snapshots are from version 0.4, version 0.7 is similar (with pylint, fxcop, stylecop, simian and gendarme added).

Configuration should be easy, First you need to have activate the static code analysizers in your build. Then activate the Violations plugin as shown below. 
 
 

The fields are:

name

description

Per file display limit

This is used to limit the number of violations displayed per file per violation type.

type

The violation type.

sun icon

This is the lowest number of violations of this type to generate the sunny weather report. For example the value 10 means that violations 0 to 10 will cause a sunny report, 11 and higher will be cloudy or worse.

stormy icon

The is the lowest number of violations of this type to generate the stormy weather report.

XML filename pattern

This is an ant type pattern to match violation files of this type in the workspace. Multiple patterns may be separated by commas.

Source Path Pattern

This is an optional field. It is used to resolve classnames to source file names. It is only currently used by the findbugs violations type.

Faux Project Path

This is an optional field. It is used if you just want to run jenkins as a reporting engine for a project not in jenkins workspace. For example, the violations plugin has a jenkins job that cd's to the cvs directory, creates the checkstyle, pmd and cpd reports and the invokes violations plugin with the faux project path set to (PATH TO CVS DIR)/plugins/violations.

After configuration, the Violations plugin will collect violations from the next build. The following pages are created or modified.

Project Page

The project page is modified to add a violation icon ( ) and a violation trend graph:

Clicking on the violations link brings one to the current violations report. 

Build page


The build page also has the violations trend and the violations icon. Clinking on the violations link brings one to the violations report for this particular build.

 Violations report page

Note the following snapshots are from 0.4, 0.7 is similar, except that the +/- notation has been removed.

The start of the violations report page looks like this:

For each violation type a trend and file summary is shown as follows:
The order of the table can be changed by clinking on the column header.

 Per File Report

Linking on the file link brings on to the file report. This will show all the violations (up to a limit specified in the config page) of a file, Each violation has a line number, an icon representing the severity and a description of the violation. Hovering over the icon will give more detail on the violation - and for findbugs, this will be the long detailed message. After the list of violations, snipets from the source file will be shown for each violation. This will only happen if the violations plugin can find the file in question.

 
.
 Hovering over the violations icon on the highlighted line will cause a pop-up of the violations on the line:

Version History

Version 0.7.11:

Version 0.7.10:

Version 0.7.9:

Version 0.7.8:

Version 0.7.7: upcoming

Version 0.7.6: Aug 01, 2010

Version 0.7.5: Dec 29, 2009

Version 0.7.3: Feb 11, 2009

Version 0.7.1: August 25, 2008

Version 0.7.0: May 28, 2008

Version 0.6.0: May 5, 2008

Version 0.5.8 April 22, 2008

Version 0.5.7 April 16, 2008

Version 0.5.6 April 8, 2008

Version 0.5.5 March 30, 2008

Version 0.5.3 Oct 22 2007

Version 0.5.2 Oct 10 2007

Version 0.5.1 Sep 28 2007

Version 0.5 Sep 24 2007

Version 0.4 Aug 15 2007

Version 0.3 Aug 10 2007

Version 0.2 Aug 08 2007

Version 0.1 Aug 08 2007