Issue Type: Bug Bug
Assignee: peterkittreilly
Attachments: ImageMetaData.cs.xml, Jenkins_FxCop_Violations_Plugin_Problem.jpg, Project.Domain.Model.Interfaces.IProjectStub.xml
Components: violations
Created: 09/Apr/13 7:17 PM
Description:

If a violation is found (by FxCop) for which there is no source code (such as a DLL), the Violations plugin does not display the actual violation message (just blank page with a red triangle with an "!" in it).

This appears to be due to the plugin only displaying the "popup-message" for the errors when the user mouses-over the warning in the code view.

However, if there is no code to view, there is no method to display the violations. Also, the violation "message" section is not displayed in either case (it needs to be as it contains valuable information).

More Info

Specifying FxCop output (XML) file in the Violations plugin will cause the Violation plugin to parse the (FxCop) XML file(s) generating violation (XML) files for each file (each of these XML files can contain multiple violations). These (Violation plugin) XML files are stored in the "~\jobs\<jenkins_job_name>\builds\<build_date_&_time>\violations\file" folder with ".xml" appended to the original file name (e.g.: domain.interface.dll -> domain.interface.dll.xml). When the user clicks on a source file (within the Violations plugin results page, the Violations XML file is parsed and displayed on the screen.)

Each of these (Violations plugin) XML files contain a "file", (multiple) "violation", "line" and "type" sections.

File Section

The "file" section (of the XML file) contains the file "name", "last-modified" date, and a link to the "file" (if applicable):

<file name="Server/Project.Server/Project.Domain.Model/ImageMetaData.cs"
last-modified="1365521927609" file="c:\Jenkins\workspace\Project_Server_FxCop\Server\Projecty.Server\Project.Domain.Model\ImageMetaData.cs"
>

Violations

The "violations" section contain the "line", violation "source", violation "severity", violation "type", violation "message", violation "severity-level", and the violation "popup-message":

<violation
line="82"
source="Naming#CA1702"
severity="Medium High"
type="fxcop"
message="<a href=""
severity-level="1"
popup-message="Avoid creating compound words from terms which exist in the dictionary as discrete terms. Do not create a compound word such as 'StopWatch' or 'PopUp'. These terms are recognized in the dictionary and should be cased as 'Stopwatch' and 'Popup'."
/>

Line Number

Next, the Violations XML file contains a section containing zero or multiple "line number" entries which contain code from the source file.

<line number='81'> public virtual bool IsMetaDataEqual(ImageMetaData imageMetaData)</line>
<line number='82'> {</line>
<line number='83'> if (Hash == imageMetaData.Hash &&</line>
<line number='84'> Type == imageMetaData.Type &&</line>
<line number='85'> FileLength == imageMetaData.FileLength</line>
<line number='86'> )</line>
<line number='87'> {</line>

Type

Finally, the "type" section indicates that it is "fxcop" and also contains the total number of violations found:

<type type='fxcop' number='2' suppressed='0'/>

If the file does not contain code, then all the violation line numbers are set to 0 (zero) and there is no "line number" section in the Violations plugin XML files. (See attached files: "ImageMetaData.cs.xml" and "Project.Domain.Model.Interfaces.IProjectStub.xml")

The problem is two-fold: First if the file is not a source code file then no violations are displayed at all (see attached screenshot). Second, the "message" data is not displayed in either case (and in most cases contains more valuable information than the "popup-message").

The Violations plugin should display a table of the "messages" and "popup-messages" if there is no code to display, and the "messages" text should be added to the pop-up table when there is code to display.

Environment: Windows Server 2008 R2 Enterprise, Jenkins 1.510, Violations plugin 0.7.11
Project: Jenkins
Labels: FxCop violations
Priority: Major Major
Reporter: Jeff Hughes
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to