Commits

Fred Grott committed 890d977

first commit

  • Participants

Comments (0)

Files changed (175)

+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
+bin/
+gen/
+local.properties
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>JLee</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

File AndroidManifest.xml

+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="org.bitbucket.fredgrott.jlee"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <uses-sdk android:minSdkVersion="15" />
+
+    <application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
+        <activity android:name="MainActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+</manifest>

File build.res/antlibs/zutubi-android-ant-0.1.2.jar

Binary file added.

File build.res/codeqa.res/css/fcoltable.css

+body{
+	font-family:Arial,Sans-Serif;
+	font-size:90%;
+	background:#cc9;
+}
+#boundary{
+	background:#f8f8f8;
+	padding:2em;
+	width:40em;
+}
+h1{
+	font-family:"Trebuchet MS",Sans-serif;
+	text-transform:uppercase;
+	color:#696;
+	font-size:120%;
+}
+
+table.footcollapse{
+	width:100%;
+}
+table.footcollapse caption{
+	font-size:120%;
+	text-transform:uppercase;
+	text-align:left;
+	padding:.5em 1em;
+}
+table.footcollapse th{
+	text-align:left;
+}
+table.footcollapse,table.footcollapse th,table.footcollapse th
+{
+	border:none;
+	border-collapse:collapse;	
+}
+table.footcollapse thead th
+{
+	width:10em;
+	border-style:solid;
+	border-width:1px;
+	border-color:#cff #69c #69c #cff;
+	background:#9cf;
+	padding:2px 10px;
+}
+table.footcollapse tfoot th,
+table.footcollapse tfoot td
+{
+	border-style:solid;
+	border-width:1px;
+	border-color:#9cf #369 #369 #9cf;
+	background:#69c;
+	padding:2px 10px;
+}
+table.footcollapse tbody{
+	background:#ddd;
+}
+table.footcollapse tbody td{
+	padding:5px 10px;
+	border:1px solid #999;
+}
+table.footcollapse tbody th{
+	padding:2px 10px;
+	border:1px solid #999;
+	border-left:none;
+}
+table.footcollapse tbody tr.odd{
+	background:#ccc;
+}
+
+table.footcollapse tfoot td img{
+	border:none;
+	vertical-align:bottom;
+	padding-left:10px;
+	float:right;
+}
+

File build.res/codeqa.res/css/reports.css

+@font-face {
+font-family: Cantarell-Bold;
+src: url("fonts/Cantarell-Bold.ttf") format("truetype");
+}
+@font-face {
+font-family: Cantarell-Regular;
+src: url("fonts/Cantarell-Regular.ttf") format("truetype");
+}
+@font-face {
+font-family: Cantarell-Oblique;
+src: url("fonts/Cantarel-Oblique.ttf") format("truetype");
+}
+@font-face {
+font-family: CrimsonText-Roman;
+src: url("fonts/CrimsonText-roman.ttf") format("truetype");
+}
+
+
+body {
+  font-size: 98%;
+  font-family: Cantarell-Bold, Cantarell-Regular, Cantarell-Oblique, CrimsonText-Roman;
+}
+ 
+th, td {
+  text-align: left;
+  padding: 5px;
+  
+} 
+
+td a img { 
+   border-width:0; 
+   margin-left:5pt; 
+   vertical-align:middle;
+}
+
+table tr th {
+  font-weight: bold;
+}
+
+table.details tr th {
+  background-color: #a6caf0;
+}
+
+table.details tr td {
+  background-color: #eeeee0;
+}
+
+table.summary tr th {
+  background-color: #d6caf0;
+}
+
+table.summary tr td {
+  background-color: #eeeee0;
+}
+
+p {
+  line-height: 1.5em;
+  margin: 0.5em 2em 1.0em 2em;
+}
+
+h1 {
+  margin: 0px 0px 5px;
+  font: 165%;
+}
+
+h2 {
+  margin-top: 1em;
+  margin-bottom: 0.5em;
+  font: bold 125%;
+}
+
+h3 {
+  margin-bottom: 0.5em;
+  font: bold 115%;
+}
+
+h4 {
+  margin-bottom: 0.5em;
+  font: bold 100%;
+}
+
+h5 {
+  margin-bottom: 0.5em;
+  font: bold 100%;
+}
+
+h6 {
+  margin-bottom: 0.5em;
+  font: bold 100%;
+}
+
+hr {
+  height: 1px;
+}
+
+.Error {
+        font-weight:bold; color:red;
+ }
+ .Failure {
+        font-weight:bold; color:purple;
+ }
+.Properties {
+        text-align:right;
+ }

File build.res/codeqa.res/images/abstract.png

Added
New image

File build.res/codeqa.res/images/arrow_down.gif

Added
New image

File build.res/codeqa.res/images/arrow_up.gif

Added
New image

File build.res/codeqa.res/images/checkstylelogo.png

Added
New image

File build.res/codeqa.res/images/class.png

Added
New image

File build.res/codeqa.res/images/classyclelogo.png

Added
New image

File build.res/codeqa.res/images/close.gif

Added
New image

File build.res/codeqa.res/images/collapsed.gif

Added
New image

File build.res/codeqa.res/images/expanded.gif

Added
New image

File build.res/codeqa.res/images/external.png

Added
New image

File build.res/codeqa.res/images/icon_error_sml.gif

Added
New image

File build.res/codeqa.res/images/icon_info_sml.gif

Added
New image

File build.res/codeqa.res/images/icon_success_sml.gif

Added
New image

File build.res/codeqa.res/images/icon_warning_sml.gif

Added
New image

File build.res/codeqa.res/images/inner.png

Added
New image

File build.res/codeqa.res/images/innerCycleLink.png

Added
New image

File build.res/codeqa.res/images/innerabstract.png

Added
New image

File build.res/codeqa.res/images/innerclass.png

Added
New image

File build.res/codeqa.res/images/innerinterface.png

Added
New image

File build.res/codeqa.res/images/interface.png

Added
New image

File build.res/codeqa.res/images/javancsslogo.png

Added
New image

File build.res/codeqa.res/images/jdependlogo.png

Added
New image

File build.res/codeqa.res/images/link.png

Added
New image

File build.res/codeqa.res/images/mix.png

Added
New image

File build.res/codeqa.res/images/mixedCycleLink.png

Added
New image

File build.res/codeqa.res/images/package.png

Added
New image

File build.res/codeqa.res/images/pmdlogo.png

Added
New image

File build.res/codeqa.res/js/fcoltable.js

+function tablecollapse()
+{
+	/* Variables */
+	var collapseClass='footcollapse';
+	var collapsePic='arrow_up.gif';
+	var expandPic='arrow_down.gif';
+	var initialCollapse=true;
+
+	// loop through all tables
+	var t=document.getElementsByTagName('table');
+	var checktest= new RegExp("(^|\\s)" + collapseClass + "(\\s|$)");
+	for (var i=0;i<t.length;i++)
+	{
+		// if the table has not the right class, skip it
+		if(!checktest.test(t[i].className)){continue;}		
+
+		// make the footer clickable
+		t[i].getElementsByTagName('tfoot')[0].onclick=function()
+		{
+			// loop through all bodies of this table and show or hide 
+			// them
+			var tb=this.parentNode.getElementsByTagName('tbody');
+			for(var i=0;i<tb.length;i++)
+			{
+				tb[i].style.display=tb[i].style.display=='none'?'':'none';
+			}			
+			// change the image accordingly
+			var li=this.getElementsByTagName('img')[0];
+			li.src=li.src.indexOf(collapsePic)==-1?collapsePic:expandPic;	
+		}
+		// if the bodies should be collapsed initially, do so
+		if(initialCollapse)
+		{
+			var tb=t[i].getElementsByTagName('tbody');
+			for(var j=0;j<tb.length;j++)
+			{
+				tb[j].style.display='none';
+			}			
+		}
+		// add the image surrounded by a dummy link to allow keyboard 
+		// access to the last cell in the footer
+		var newa=document.createElement('a');
+		newa.href='#';
+		newa.onclick=function(){return false;}
+		var newimg=document.createElement('img');
+		newimg.src=initialCollapse?expandPic:collapsePic;
+		var tf=t[i].getElementsByTagName('tfoot')[0];
+		var lt=tf.getElementsByTagName('td')[tf.getElementsByTagName('td').length-1];
+		newa.appendChild(newimg);
+		lt.insertBefore(newa,lt.firstChild);
+	}		
+}
+
+
+// run tablecollapse when the page loads
+window.onload=tablecollapse;
+

File build.res/codeqa.res/js/sorttable.js

+//$Header$
+addEvent(window, "load", sortables_init);
+
+var SORT_COLUMN_INDEX;
+
+function sortables_init() {
+    // Find all tables with class sortable and make them sortable
+    if (!document.getElementsByTagName) return;
+    tbls = document.getElementsByTagName("table");
+    for (ti=0;ti<tbls.length;ti++) {
+        thisTbl = tbls[ti];
+        if (((' '+thisTbl.className+' ').indexOf("sortable") != -1) && (thisTbl.id)) {
+            //initTable(thisTbl.id);
+            ts_makeSortable(thisTbl);
+        }
+    }
+}
+
+function ts_makeSortable(table) {
+    if (table.rows && table.rows.length > 0) {
+        var firstRow = table.rows[0];
+    }
+    if (!firstRow) return;
+    
+    // We have a first row: assume it's the header, and make its contents clickable links
+    for (var i=0;i<firstRow.cells.length;i++) {
+        var cell = firstRow.cells[i];
+        var txt = ts_getInnerText(cell);
+        cell.innerHTML = '<a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'+txt+'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a>';
+    }
+}
+
+function ts_getInnerText(el) {
+	if (typeof el == "string") return el;
+	if (typeof el == "undefined") { return el };
+	if (el.innerText) return el.innerText;	//Not needed but it is faster
+	var str = "";
+	
+	var cs = el.childNodes;
+	var l = cs.length;
+	for (var i = 0; i < l; i++) {
+		switch (cs[i].nodeType) {
+			case 1: //ELEMENT_NODE
+				str += ts_getInnerText(cs[i]);
+				break;
+			case 3:	//TEXT_NODE
+				str += cs[i].nodeValue;
+				break;
+		}
+	}
+	return str;
+}
+
+function ts_resortTable(lnk) {
+    // get the span
+    var span;
+    for (var ci=0;ci<lnk.childNodes.length;ci++) {
+        if (lnk.childNodes[ci].tagName && lnk.childNodes[ci].tagName.toLowerCase() == 'span') span = lnk.childNodes[ci];
+    }
+    var spantext = ts_getInnerText(span);
+    var td = lnk.parentNode;
+    var column = td.cellIndex;
+    var table = getParent(td,'TABLE');
+    
+    // Work out a type for the column
+    if (table.rows.length <= 1) return;
+    var itm = ts_getInnerText(table.rows[1].cells[column]);
+    sortfn = ts_sort_caseinsensitive;
+    if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d\d\d$/)) sortfn = ts_sort_date;
+    if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d$/)) sortfn = ts_sort_date;
+    if (itm.match(/^[�$]/)) sortfn = ts_sort_currency;
+    if (itm.match(/^[\d\.]+$/)) sortfn = ts_sort_numeric;
+    SORT_COLUMN_INDEX = column;
+    var firstRow = new Array();
+    var newRows = new Array();
+    for (i=0;i<table.rows[0].length;i++) { firstRow[i] = table.rows[0][i]; }
+    for (j=1;j<table.rows.length;j++) { newRows[j-1] = table.rows[j]; }
+
+    newRows.sort(sortfn);
+
+    if (span.getAttribute("sortdir") == 'down') {
+        ARROW = '&nbsp;&nbsp;&uarr;';
+        newRows.reverse();
+        span.setAttribute('sortdir','up');
+    } else {
+        ARROW = '&nbsp;&nbsp;&darr;';
+        span.setAttribute('sortdir','down');
+    }
+    
+    // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
+    // don't do sortbottom rows
+    for (i=0;i<newRows.length;i++) { if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) table.tBodies[0].appendChild(newRows[i]);}
+    // do sortbottom rows only
+    for (i=0;i<newRows.length;i++) { if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1)) table.tBodies[0].appendChild(newRows[i]);}
+    
+    // Delete any other arrows there may be showing
+    var allspans = document.getElementsByTagName("span");
+    for (var ci=0;ci<allspans.length;ci++) {
+        if (allspans[ci].className == 'sortarrow') {
+            if (getParent(allspans[ci],"table") == getParent(lnk,"table")) { // in the same table as us?
+                allspans[ci].innerHTML = '&nbsp;&nbsp;&nbsp;';
+            }
+        }
+    }
+        
+    span.innerHTML = ARROW;
+}
+
+function getParent(el, pTagName) {
+	if (el == null) return null;
+	else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())	// Gecko bug, supposed to be uppercase
+		return el;
+	else
+		return getParent(el.parentNode, pTagName);
+}
+function ts_sort_date(a,b) {
+    // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
+    if (aa.length == 10) {
+        dt1 = aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);
+    } else {
+        yr = aa.substr(6,2);
+        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
+        dt1 = yr+aa.substr(3,2)+aa.substr(0,2);
+    }
+    if (bb.length == 10) {
+        dt2 = bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);
+    } else {
+        yr = bb.substr(6,2);
+        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
+        dt2 = yr+bb.substr(3,2)+bb.substr(0,2);
+    }
+    if (dt1==dt2) return 0;
+    if (dt1<dt2) return -1;
+    return 1;
+}
+
+function ts_sort_currency(a,b) { 
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
+    return parseFloat(aa) - parseFloat(bb);
+}
+
+function ts_sort_numeric(a,b) { 
+    aa = parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));
+    if (isNaN(aa)) aa = 0;
+    bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); 
+    if (isNaN(bb)) bb = 0;
+    return aa-bb;
+}
+
+function ts_sort_caseinsensitive(a,b) {
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase();
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase();
+    if (aa==bb) return 0;
+    if (aa<bb) return -1;
+    return 1;
+}
+
+function ts_sort_default(a,b) {
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
+    if (aa==bb) return 0;
+    if (aa<bb) return -1;
+    return 1;
+}
+
+
+function addEvent(elm, evType, fn, useCapture)
+// addEvent and removeEvent
+// cross-browser event handling for IE5+,  NS6 and Mozilla
+// By Scott Andrew
+{
+  if (elm.addEventListener){
+    elm.addEventListener(evType, fn, useCapture);
+    return true;
+  } else if (elm.attachEvent){
+    var r = elm.attachEvent("on"+evType, fn);
+    return r;
+  } else {
+    alert("Handler could not be removed");
+  }
+} 

File build.res/codeqa.res/orig.xsls.before.modifications/chart_ccn.xsl

+<?xml version="1.0"?>  
+<!-- Abstract : Style sheet to present data generated by JavaNCSS as a        -->
+<!--            frequency table in a bar chart in SVG format.                 -->
+<!--            Range of metric on y-axis is 0 to 4*average.                  -->
+<!-- File     : chart_ccn.xsl                                                 -->
+<!-- Usage    : xt javancss_out.xml chart_ccn.xsl chart_ccn.svg               -->
+<!-- Requires : XT and SVG plugin from www.adobe.com/svg                      -->
+<!-- Input    : XML output of JavaNCSS tool.                                  -->
+<!-- Output   : Frequency chart METRIC v UNIT in SVG format.                  --> 
+<!-- History  : 16/08/02 Y. Coene (yves.coene13@yucom.be)                     -->
+<!--                   Original.  Shows table in SVG format.                  -->
+
+<!DOCTYPE BARCHART [
+  <!ENTITY UNIT        "javancss/functions/function">
+  <!ENTITY METRIC      "javancss/functions/function/ccn">
+  <!ENTITY SHORTMETRIC "ccn">
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+
+<!-- global variables -->
+
+     <xsl:variable name="title1">Distribution Cyclomatic</xsl:variable>
+     <xsl:variable name="title2">Complexity per Function (CCN)</xsl:variable>
+     <xsl:variable name="labelx">Functions</xsl:variable>
+     <xsl:variable name="labely">Cyclomatic Complexity</xsl:variable>
+
+     <xsl:variable name="dx">   <!-- pixels between ticks on x axis = 10*dx -->
+        35
+     </xsl:variable>
+     <xsl:variable name="dy">   <!-- pixels between ticks on y axis = dy    -->
+        220
+     </xsl:variable>
+     <xsl:variable name="x0">   <!-- x offset of origin -->
+        464
+     </xsl:variable>
+
+     <xsl:variable name="last_value">
+        <xsl:value-of select="4 * sum(&METRIC;) div count(&UNIT;)"/>
+     </xsl:variable>
+
+     <xsl:variable name="step_value">
+        <xsl:value-of select="floor($last_value div 10)+1"/>
+     </xsl:variable>
+
+
+<xsl:template match="/">
+  <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"&gt;
+</xsl:text>
+
+ <svg width="436pt" height="327pt" viewBox="0 0 4360 3270">
+ <rect x="40" y="30" width="4320" height="3240" style="fill:silver;"/>
+ <rect x="3" y="3" width="4314" height="3234" style="fill:white; stroke-width:6; stroke:black"/>
+ <g style="fill:#FFFFFF; stroke-width:15; stroke:black">
+     <rect x="40" y="40" width="4240" height="3160"/>
+ </g>
+
+ <g style="fill:#000080; font-family:Times New Roman;font-style:italic; font-size:180; text-anchor:end;">
+     <text id="Heading" x="4100" y="256"><xsl:value-of select="$title1"/></text>
+     <text x="4100" y="456"><xsl:value-of select="$title2"/></text>
+ </g>
+
+ <g transform="translate(190 640) rotate(-90)" style="fill:#008080; font-family:Times New Roman;font-size:100; text-anchor:end; ">
+     <text><xsl:value-of select="$labely"/></text>
+ </g>
+ <g style="fill:#008000; font-family:Arial;font-size:100;">
+ <text id="Notes" x="2535" y="1080">Average <xsl:value-of select="$labely"/> = 
+       <xsl:value-of select="format-number(sum(&METRIC;) div count(&UNIT;),'0.00')"/>
+ </text>
+ <text x="2535" y="1200">Total <xsl:value-of select="$labelx"/> = 
+      <xsl:value-of select="count(&UNIT;)"/>
+ </text>
+ <text x="2535" y="1320">Total <xsl:value-of select="$labely"/> = 
+      <xsl:value-of select="sum(&METRIC;)"/>
+ </text>
+
+ </g>
+ <text x="4100" y="3110" style="fill:#008080; font-family:Times New Roman;font-size:100; text-anchor:end;"><xsl:value-of select="$labelx"/></text>
+
+ <g style="font-family:Times New Roman;font-size:80; text-anchor:middle;">
+  <text x="{($x0)+0}" y="2970"> 0%</text>
+  <text x="{$x0+10*$dx}" y="2970">10%</text>
+  <text x="{$x0+20*$dx}" y="2970">20%</text>
+  <text x="{$x0+30*$dx}" y="2970">30%</text>
+  <text x="{$x0+40*$dx}" y="2970">40%</text>
+  <text x="{$x0+50*$dx}" y="2970">50%</text>
+  <text x="{$x0+60*$dx}" y="2970">60%</text>
+  <text x="{$x0+70*$dx}" y="2970">70%</text>
+  <text x="{$x0+80*$dx}" y="2970">80%</text>
+  <text x="{$x0+90*$dx}" y="2970">90%</text>
+  <text x="{$x0+100*$dx}" y="2970">100%</text>
+ </g>
+
+ <!-- x-axis with ticks -->
+ <path style="stroke:#000000; stroke-width:6" d="M {($x0)+0},2842 L {($x0)+0},2881 z M {($x0)+10*$dx},2842 L {($x0)+10*$dx},2881 z M {($x0)+20*$dx},2842 L {$x0+20*$dx},2881 z M {$x0+30*$dx},2842 L {$x0+30*$dx},2881 z M {$x0+40*$dx},2842 L {$x0+40*$dx},2881 z M {$x0+50*$dx},2842 L {$x0+50*$dx},2881 z M {$x0+60*$dx},2842 L {$x0+60*$dx},2881 z M {$x0+70*$dx},2842 L {$x0+70*$dx},2881 z M {$x0+80*$dx},2842 L {$x0+80*$dx},2881 z M {$x0+90*$dx},2842 L {$x0+90*$dx},2881 z M {$x0+100*$dx},2842 L {$x0+100*$dx},2881 z  M {$x0+100*$dx},2842 L {$x0+0*$dx},2842 z"/>
+
+ <!-- y-axis without ticks -->
+ <path style="stroke:#000000; stroke-width:6" d="M {($x0)+0},2842 L {($x0)+0},300 z"/>
+
+       <xsl:call-template name="LOOP">
+          <xsl:with-param name="n">0</xsl:with-param>
+          <xsl:with-param name="last">10</xsl:with-param>  <!-- defines number of horizontal bars -->
+       </xsl:call-template>
+
+  </svg>
+</xsl:template>
+
+
+<!-- named templates to simplify ...  Use recursion to implement loop  -->
+
+<xsl:template name="ITEM">
+   <xsl:param name="i">0</xsl:param>
+   <xsl:param name="x">0</xsl:param>
+   <xsl:param name="y">0</xsl:param>
+   <xsl:param name="p">0</xsl:param>
+
+   <!-- tick on vertical axis -->
+   <path style="stroke:#000000; stroke-width:6" d="M {($x0)-30},{2842-$i*$dy} L {($x0)-1},{2842-$i*$dy} z"/>
+
+   <!-- label on vertical axis -->
+   <g style="font-family:Times New Roman;font-size:80; text-anchor:end;">
+       <text x='{($x0)-40}' y='{2842-$i*$dy}'>
+           <xsl:value-of select="$x"/>
+       </text>
+   </g>
+
+   <!-- rectangle representing frequency (0 to 100)-->
+   <g style="fill:#DBDBED;stroke-width:4; stroke:black">
+       <rect x="{($x0)+0}" y='{2842-$i*($dy)-176-24}' width="{format-number($p*$dx*100,'0')}" height="{($dy)-44}"/>
+   </g>
+</xsl:template>
+
+
+<xsl:template name="LOOP">
+    <xsl:param name="n">0</xsl:param>
+    <xsl:param name="last">0</xsl:param>
+
+    <xsl:variable name="cnt">
+        <xsl:choose>
+        <xsl:when test="$n &lt; $last">
+            <xsl:value-of select="count(&UNIT;[&SHORTMETRIC; >= $step_value*$n and &SHORTMETRIC; &lt; $step_value*($n+1) ])"/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="count(&UNIT;[&SHORTMETRIC; >= $step_value*$n])"/>
+        </xsl:otherwise>
+        </xsl:choose>
+     </xsl:variable>
+
+     <xsl:call-template name="ITEM">
+          <xsl:with-param name="i"><xsl:value-of select="$n"/></xsl:with-param>
+          <xsl:with-param name="x"><xsl:value-of select="$step_value*$n"/></xsl:with-param>
+          <xsl:with-param name="y"><xsl:value-of select="$cnt"/></xsl:with-param>
+          <xsl:with-param name="p"><xsl:value-of select="$cnt div count(&UNIT;)"/></xsl:with-param>
+     </xsl:call-template>
+
+     <xsl:if test="$n &lt; $last">
+        <xsl:call-template name="LOOP">
+            <xsl:with-param name="n">
+              <xsl:value-of select="$n+1"/>
+            </xsl:with-param>
+            <xsl:with-param name="last">
+              <xsl:value-of select="$last"/>
+            </xsl:with-param>
+        </xsl:call-template>
+     </xsl:if>  
+
+</xsl:template>
+
+</xsl:stylesheet> 

File build.res/codeqa.res/orig.xsls.before.modifications/chart_function_package.xsl

+<?xml version="1.0"?>  
+<!-- Abstract : Style sheet to present data generated by JavaNCSS as a        -->
+<!--            frequency table in a bar chart in SVG format.                 -->
+<!--            Range of metric on y-axis is 0 to 4*average.                  -->
+<!-- File     : chart_function_package.xsl                                    -->
+<!-- Usage    : xt javancss_out.xml chart_function_package.xsl                -->
+<!--            chart_function_package.svg                                    -->
+<!-- Requires : XT and SVG plugin from www.adobe.com/svg                      -->
+<!-- Input    : XML output of JavaNCSS tool.                                  -->
+<!-- Output   : Frequency chart METRIC v UNIT in SVG format.                  --> 
+<!-- History  : 16/08/02 Y. Coene (yves.coene13@yucom.be)                     -->
+<!--                   Original.  Shows table in SVG format.                  -->
+
+<!DOCTYPE BARCHART [
+  <!ENTITY UNIT        "javancss/packages/package">
+  <!ENTITY METRIC      "javancss/packages/package/functions">
+  <!ENTITY SHORTMETRIC "functions">
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+
+<!-- global variables -->
+
+     <xsl:variable name="title1">Distribution Functions</xsl:variable>
+     <xsl:variable name="title2">per Package</xsl:variable>
+     <xsl:variable name="labelx">Packages</xsl:variable>
+     <xsl:variable name="labely">Functions</xsl:variable>
+
+     <xsl:variable name="dx">   <!-- pixels between ticks on x axis = 10*dx -->
+        35
+     </xsl:variable>
+     <xsl:variable name="dy">   <!-- pixels between ticks on y axis = dy    -->
+        220
+     </xsl:variable>
+     <xsl:variable name="x0">   <!-- x offset of origin -->
+        464
+     </xsl:variable>
+
+     <xsl:variable name="last_value">
+        <xsl:value-of select="4 * sum(&METRIC;) div count(&UNIT;)"/>
+     </xsl:variable>
+
+     <xsl:variable name="step_value">
+        <xsl:value-of select="floor($last_value div 10)+1"/>
+     </xsl:variable>
+
+
+<xsl:template match="/">
+  <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"&gt;
+</xsl:text>
+
+ <svg width="436pt" height="327pt" viewBox="0 0 4360 3270">
+ <rect x="40" y="30" width="4320" height="3240" style="fill:silver;"/>
+ <rect x="3" y="3" width="4314" height="3234" style="fill:white; stroke-width:6; stroke:black"/>
+ <g style="fill:#FFFFFF; stroke-width:15; stroke:black">
+     <rect x="40" y="40" width="4240" height="3160"/>
+ </g>
+
+ <g style="fill:#000080; font-family:Times New Roman;font-style:italic; font-size:180; text-anchor:end;">
+     <text id="Heading" x="4100" y="256"><xsl:value-of select="$title1"/></text>
+     <text x="4100" y="456"><xsl:value-of select="$title2"/></text>
+ </g>
+
+ <g transform="translate(190 640) rotate(-90)" style="fill:#008080; font-family:Times New Roman;font-size:100; text-anchor:end; ">
+     <text><xsl:value-of select="$labely"/></text>
+ </g>
+ <g style="fill:#008000; font-family:Arial;font-size:100;">
+ <text id="Notes" x="2535" y="1080">Average <xsl:value-of select="$labely"/> = 
+       <xsl:value-of select="format-number(sum(&METRIC;) div count(&UNIT;),'0.00')"/>
+ </text>
+ <text x="2535" y="1200">Total <xsl:value-of select="$labelx"/> = 
+      <xsl:value-of select="count(&UNIT;)"/>
+ </text>
+ <text x="2535" y="1320">Total <xsl:value-of select="$labely"/> = 
+      <xsl:value-of select="sum(&METRIC;)"/>
+ </text>
+
+ </g>
+ <text x="4100" y="3110" style="fill:#008080; font-family:Times New Roman;font-size:100; text-anchor:end;"><xsl:value-of select="$labelx"/></text>
+
+ <g style="font-family:Times New Roman;font-size:80; text-anchor:middle;">
+  <text x="{($x0)+0}" y="2970"> 0%</text>
+  <text x="{$x0+10*$dx}" y="2970">10%</text>
+  <text x="{$x0+20*$dx}" y="2970">20%</text>
+  <text x="{$x0+30*$dx}" y="2970">30%</text>
+  <text x="{$x0+40*$dx}" y="2970">40%</text>
+  <text x="{$x0+50*$dx}" y="2970">50%</text>
+  <text x="{$x0+60*$dx}" y="2970">60%</text>
+  <text x="{$x0+70*$dx}" y="2970">70%</text>
+  <text x="{$x0+80*$dx}" y="2970">80%</text>
+  <text x="{$x0+90*$dx}" y="2970">90%</text>
+  <text x="{$x0+100*$dx}" y="2970">100%</text>
+ </g>
+
+ <!-- x-axis with ticks -->
+ <path style="stroke:#000000; stroke-width:6" d="M {($x0)+0},2842 L {($x0)+0},2881 z M {($x0)+10*$dx},2842 L {($x0)+10*$dx},2881 z M {($x0)+20*$dx},2842 L {$x0+20*$dx},2881 z M {$x0+30*$dx},2842 L {$x0+30*$dx},2881 z M {$x0+40*$dx},2842 L {$x0+40*$dx},2881 z M {$x0+50*$dx},2842 L {$x0+50*$dx},2881 z M {$x0+60*$dx},2842 L {$x0+60*$dx},2881 z M {$x0+70*$dx},2842 L {$x0+70*$dx},2881 z M {$x0+80*$dx},2842 L {$x0+80*$dx},2881 z M {$x0+90*$dx},2842 L {$x0+90*$dx},2881 z M {$x0+100*$dx},2842 L {$x0+100*$dx},2881 z  M {$x0+100*$dx},2842 L {$x0+0*$dx},2842 z"/>
+
+ <!-- y-axis without ticks -->
+ <path style="stroke:#000000; stroke-width:6" d="M {($x0)+0},2842 L {($x0)+0},300 z"/>
+
+       <xsl:call-template name="LOOP">
+          <xsl:with-param name="n">0</xsl:with-param>
+          <xsl:with-param name="last">10</xsl:with-param>  <!-- defines number of horizontal bars -->
+       </xsl:call-template>
+
+  </svg>
+</xsl:template>
+
+
+<!-- named templates to simplify ...  Use recursion to implement loop  -->
+
+<xsl:template name="ITEM">
+   <xsl:param name="i">0</xsl:param>
+   <xsl:param name="x">0</xsl:param>
+   <xsl:param name="y">0</xsl:param>
+   <xsl:param name="p">0</xsl:param>
+
+   <!-- tick on vertical axis -->
+   <path style="stroke:#000000; stroke-width:6" d="M {($x0)-30},{2842-$i*$dy} L {($x0)-1},{2842-$i*$dy} z"/>
+
+   <!-- label on vertical axis -->
+   <g style="font-family:Times New Roman;font-size:80; text-anchor:end;">
+       <text x='{($x0)-40}' y='{2842-$i*$dy}'>
+           <xsl:value-of select="$x"/>
+       </text>
+   </g>
+
+   <!-- rectangle representing frequency (0 to 100)-->
+   <g style="fill:#DBDBED;stroke-width:4; stroke:black">
+       <rect x="{($x0)+0}" y='{2842-$i*($dy)-176-24}' width="{format-number($p*$dx*100,'0')}" height="{($dy)-44}"/>
+   </g>
+</xsl:template>
+
+
+<xsl:template name="LOOP">
+    <xsl:param name="n">0</xsl:param>
+    <xsl:param name="last">0</xsl:param>
+
+    <xsl:variable name="cnt">
+        <xsl:choose>
+        <xsl:when test="$n &lt; $last">
+            <xsl:value-of select="count(&UNIT;[&SHORTMETRIC; >= $step_value*$n and &SHORTMETRIC; &lt; $step_value*($n+1) ])"/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="count(&UNIT;[&SHORTMETRIC; >= $step_value*$n])"/>
+        </xsl:otherwise>
+        </xsl:choose>
+     </xsl:variable>
+
+     <xsl:call-template name="ITEM">
+          <xsl:with-param name="i"><xsl:value-of select="$n"/></xsl:with-param>
+          <xsl:with-param name="x"><xsl:value-of select="$step_value*$n"/></xsl:with-param>
+          <xsl:with-param name="y"><xsl:value-of select="$cnt"/></xsl:with-param>
+          <xsl:with-param name="p"><xsl:value-of select="$cnt div count(&UNIT;)"/></xsl:with-param>
+     </xsl:call-template>
+
+     <xsl:if test="$n &lt; $last">
+        <xsl:call-template name="LOOP">
+            <xsl:with-param name="n">
+              <xsl:value-of select="$n+1"/>
+            </xsl:with-param>
+            <xsl:with-param name="last">
+              <xsl:value-of select="$last"/>
+            </xsl:with-param>
+        </xsl:call-template>
+     </xsl:if>  
+
+</xsl:template>
+
+</xsl:stylesheet> 

File build.res/codeqa.res/orig.xsls.before.modifications/chart_ncss.xsl

+<?xml version="1.0"?>  
+<!-- Abstract : Style sheet to present data generated by JavaNCSS as a        -->
+<!--            frequency table in a bar chart in SVG format.                 -->
+<!--            Range of metric on y-axis is 0 to 4*average.                  -->
+<!-- File     : chart_ncss.xsl                                                -->
+<!-- Usage    : xt javancss_out.xml chart_ncss.xsl chart_ncss.svg             -->
+<!-- Requires : XT and SVG plugin from www.adobe.com/svg                      -->
+<!-- Input    : XML output of JavaNCSS tool.                                  -->
+<!-- Output   : Frequency chart METRIC v UNIT in SVG format.                  --> 
+<!-- History  : 16/08/02 Y. Coene (yves.coene13@yucom.be)                     -->
+<!--                   Original.  Shows table in SVG format.                  -->
+
+<!DOCTYPE BARCHART [
+  <!ENTITY UNIT        "javancss/functions/function">
+  <!ENTITY METRIC      "javancss/functions/function/ncss">
+  <!ENTITY SHORTMETRIC "ncss">
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+
+<!-- global variables -->
+
+     <xsl:variable name="title1">Distribution Java Source Statements</xsl:variable>
+     <xsl:variable name="title2">per Function (NCSS)</xsl:variable>
+     <xsl:variable name="labelx">Functions</xsl:variable>
+     <xsl:variable name="labely">Java NCSS</xsl:variable>
+
+     <xsl:variable name="dx">   <!-- pixels between ticks on x axis = 10*dx -->
+        35
+     </xsl:variable>
+     <xsl:variable name="dy">   <!-- pixels between ticks on y axis = dy    -->
+        220
+     </xsl:variable>
+     <xsl:variable name="x0">   <!-- x offset of origin -->
+        464
+     </xsl:variable>
+
+     <xsl:variable name="last_value">
+        <xsl:value-of select="4 * sum(&METRIC;) div count(&UNIT;)"/>
+     </xsl:variable>
+
+     <xsl:variable name="step_value">
+        <xsl:value-of select="floor($last_value div 10)+1"/>
+     </xsl:variable>
+
+
+<xsl:template match="/">
+  <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"&gt;
+</xsl:text>
+
+ <svg width="436pt" height="327pt" viewBox="0 0 4360 3270">
+ <rect x="40" y="30" width="4320" height="3240" style="fill:silver;"/>
+ <rect x="3" y="3" width="4314" height="3234" style="fill:white; stroke-width:6; stroke:black"/>
+ <g style="fill:#FFFFFF; stroke-width:15; stroke:black">
+     <rect x="40" y="40" width="4240" height="3160"/>
+ </g>
+
+ <g style="fill:#000080; font-family:Times New Roman;font-style:italic; font-size:180; text-anchor:end;">
+     <text id="Heading" x="4100" y="256"><xsl:value-of select="$title1"/></text>
+     <text x="4100" y="456"><xsl:value-of select="$title2"/></text>
+ </g>
+
+ <g transform="translate(190 640) rotate(-90)" style="fill:#008080; font-family:Times New Roman;font-size:100; text-anchor:end; ">
+     <text><xsl:value-of select="$labely"/></text>
+ </g>
+ <g style="fill:#008000; font-family:Arial;font-size:100;">
+ <text id="Notes" x="2535" y="1080">Average <xsl:value-of select="$labely"/> = 
+       <xsl:value-of select="format-number(sum(&METRIC;) div count(&UNIT;),'0.00')"/>
+ </text>
+ <text x="2535" y="1200">Total <xsl:value-of select="$labelx"/> = 
+      <xsl:value-of select="count(&UNIT;)"/>
+ </text>
+ <text x="2535" y="1320">Total <xsl:value-of select="$labely"/> = 
+      <xsl:value-of select="sum(&METRIC;)"/>
+ </text>
+
+ </g>
+ <text x="4100" y="3110" style="fill:#008080; font-family:Times New Roman;font-size:100; text-anchor:end;"><xsl:value-of select="$labelx"/></text>
+
+ <g style="font-family:Times New Roman;font-size:80; text-anchor:middle;">
+  <text x="{($x0)+0}" y="2970"> 0%</text>
+  <text x="{$x0+10*$dx}" y="2970">10%</text>
+  <text x="{$x0+20*$dx}" y="2970">20%</text>
+  <text x="{$x0+30*$dx}" y="2970">30%</text>
+  <text x="{$x0+40*$dx}" y="2970">40%</text>
+  <text x="{$x0+50*$dx}" y="2970">50%</text>
+  <text x="{$x0+60*$dx}" y="2970">60%</text>
+  <text x="{$x0+70*$dx}" y="2970">70%</text>
+  <text x="{$x0+80*$dx}" y="2970">80%</text>
+  <text x="{$x0+90*$dx}" y="2970">90%</text>
+  <text x="{$x0+100*$dx}" y="2970">100%</text>
+ </g>
+
+ <!-- x-axis with ticks -->
+ <path style="stroke:#000000; stroke-width:6" d="M {($x0)+0},2842 L {($x0)+0},2881 z M {($x0)+10*$dx},2842 L {($x0)+10*$dx},2881 z M {($x0)+20*$dx},2842 L {$x0+20*$dx},2881 z M {$x0+30*$dx},2842 L {$x0+30*$dx},2881 z M {$x0+40*$dx},2842 L {$x0+40*$dx},2881 z M {$x0+50*$dx},2842 L {$x0+50*$dx},2881 z M {$x0+60*$dx},2842 L {$x0+60*$dx},2881 z M {$x0+70*$dx},2842 L {$x0+70*$dx},2881 z M {$x0+80*$dx},2842 L {$x0+80*$dx},2881 z M {$x0+90*$dx},2842 L {$x0+90*$dx},2881 z M {$x0+100*$dx},2842 L {$x0+100*$dx},2881 z  M {$x0+100*$dx},2842 L {$x0+0*$dx},2842 z"/>
+
+ <!-- y-axis without ticks -->
+ <path style="stroke:#000000; stroke-width:6" d="M {($x0)+0},2842 L {($x0)+0},300 z"/>
+
+       <xsl:call-template name="LOOP">
+          <xsl:with-param name="n">0</xsl:with-param>
+          <xsl:with-param name="last">10</xsl:with-param>  <!-- defines number of horizontal bars -->
+       </xsl:call-template>
+
+  </svg>
+</xsl:template>
+
+
+<!-- named templates to simplify ...  Use recursion to implement loop  -->
+
+<xsl:template name="ITEM">
+   <xsl:param name="i">0</xsl:param>
+   <xsl:param name="x">0</xsl:param>
+   <xsl:param name="y">0</xsl:param>
+   <xsl:param name="p">0</xsl:param>
+
+   <!-- tick on vertical axis -->
+   <path style="stroke:#000000; stroke-width:6" d="M {($x0)-30},{2842-$i*$dy} L {($x0)-1},{2842-$i*$dy} z"/>
+
+   <!-- label on vertical axis -->
+   <g style="font-family:Times New Roman;font-size:80; text-anchor:end;">
+       <text x='{($x0)-40}' y='{2842-$i*$dy}'>
+           <xsl:value-of select="$x"/>
+       </text>
+   </g>
+
+   <!-- rectangle representing frequency (0 to 100)-->
+   <g style="fill:#DBDBED;stroke-width:4; stroke:black">
+       <rect x="{($x0)+0}" y='{2842-$i*($dy)-176-24}' width="{format-number($p*$dx*100,'0')}" height="{($dy)-44}"/>
+   </g>
+</xsl:template>
+
+
+<xsl:template name="LOOP">
+    <xsl:param name="n">0</xsl:param>
+    <xsl:param name="last">0</xsl:param>
+
+    <xsl:variable name="cnt">
+        <xsl:choose>
+        <xsl:when test="$n &lt; $last">
+            <xsl:value-of select="count(&UNIT;[&SHORTMETRIC; >= $step_value*$n and &SHORTMETRIC; &lt; $step_value*($n+1) ])"/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="count(&UNIT;[&SHORTMETRIC; >= $step_value*$n])"/>
+        </xsl:otherwise>
+        </xsl:choose>
+     </xsl:variable>
+
+     <xsl:call-template name="ITEM">
+          <xsl:with-param name="i"><xsl:value-of select="$n"/></xsl:with-param>
+          <xsl:with-param name="x"><xsl:value-of select="$step_value*$n"/></xsl:with-param>
+          <xsl:with-param name="y"><xsl:value-of select="$cnt"/></xsl:with-param>
+          <xsl:with-param name="p"><xsl:value-of select="$cnt div count(&UNIT;)"/></xsl:with-param>
+     </xsl:call-template>
+
+     <xsl:if test="$n &lt; $last">
+        <xsl:call-template name="LOOP">
+            <xsl:with-param name="n">
+              <xsl:value-of select="$n+1"/>
+            </xsl:with-param>
+            <xsl:with-param name="last">
+              <xsl:value-of select="$last"/>
+            </xsl:with-param>
+        </xsl:call-template>
+     </xsl:if>  
+
+</xsl:template>
+
+</xsl:stylesheet> 

File build.res/codeqa.res/orig.xsls.before.modifications/chart_ncss_package.xsl

+<?xml version="1.0"?>  
+<!-- Abstract : Style sheet to present data generated by JavaNCSS as a        -->
+<!--            frequency table in a bar chart in SVG format.                 -->
+<!--            Range of metric on y-axis is 0 to 4*average.                  -->
+<!-- File     : chart_ncss_package.xsl                                        -->
+<!-- Usage    : xt javancss_out.xml chart_ncss_package.xsl                    -->
+<!--            chart_ncss_package.svg                                        -->
+<!-- Requires : XT and SVG plugin from www.adobe.com/svg                      -->
+<!-- Input    : XML output of JavaNCSS tool.                                  -->
+<!-- Output   : Frequency chart METRIC v UNIT in SVG format.                  --> 
+<!-- History  : 16/08/02 Y. Coene (yves.coene13@yucom.be)                     -->
+<!--                   Original.  Shows table in SVG format.                  -->
+
+<!DOCTYPE BARCHART [
+  <!ENTITY UNIT        "javancss/packages/package">
+  <!ENTITY METRIC      "javancss/packages/package/ncss">
+  <!ENTITY SHORTMETRIC "ncss">
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+
+<!-- global variables -->
+
+     <xsl:variable name="title1">Distribution Java Source Statements</xsl:variable>
+     <xsl:variable name="title2">per Package (NCSS)</xsl:variable>
+     <xsl:variable name="labelx">Packages</xsl:variable>
+     <xsl:variable name="labely">Java NCSS</xsl:variable>
+
+     <xsl:variable name="dx">   <!-- pixels between ticks on x axis = 10*dx -->
+        35
+     </xsl:variable>
+     <xsl:variable name="dy">   <!-- pixels between ticks on y axis = dy    -->
+        220
+     </xsl:variable>
+     <xsl:variable name="x0">   <!-- x offset of origin -->
+        464
+     </xsl:variable>
+
+     <xsl:variable name="last_value">
+        <xsl:value-of select="4 * sum(&METRIC;) div count(&UNIT;)"/>
+     </xsl:variable>
+
+     <xsl:variable name="step_value">
+        <xsl:value-of select="floor($last_value div 10)+1"/>
+     </xsl:variable>
+
+
+<xsl:template match="/">
+  <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"&gt;
+</xsl:text>
+
+ <svg width="436pt" height="327pt" viewBox="0 0 4360 3270">
+ <rect x="40" y="30" width="4320" height="3240" style="fill:silver;"/>
+ <rect x="3" y="3" width="4314" height="3234" style="fill:white; stroke-width:6; stroke:black"/>
+ <g style="fill:#FFFFFF; stroke-width:15; stroke:black">
+     <rect x="40" y="40" width="4240" height="3160"/>
+ </g>
+
+ <g style="fill:#000080; font-family:Times New Roman;font-style:italic; font-size:180; text-anchor:end;">
+     <text id="Heading" x="4100" y="256"><xsl:value-of select="$title1"/></text>
+     <text x="4100" y="456"><xsl:value-of select="$title2"/></text>
+ </g>
+
+ <g transform="translate(190 640) rotate(-90)" style="fill:#008080; font-family:Times New Roman;font-size:100; text-anchor:end; ">
+     <text><xsl:value-of select="$labely"/></text>
+ </g>
+ <g style="fill:#008000; font-family:Arial;font-size:100;">
+ <text id="Notes" x="2535" y="1080">Average <xsl:value-of select="$labely"/> = 
+       <xsl:value-of select="format-number(sum(&METRIC;) div count(&UNIT;),'0.00')"/>
+ </text>
+ <text x="2535" y="1200">Total <xsl:value-of select="$labelx"/> = 
+      <xsl:value-of select="count(&UNIT;)"/>
+ </text>
+ <text x="2535" y="1320">Total <xsl:value-of select="$labely"/> = 
+      <xsl:value-of select="sum(&METRIC;)"/>
+ </text>
+
+ </g>
+ <text x="4100" y="3110" style="fill:#008080; font-family:Times New Roman;font-size:100; text-anchor:end;"><xsl:value-of select="$labelx"/></text>
+
+ <g style="font-family:Times New Roman;font-size:80; text-anchor:middle;">
+  <text x="{($x0)+0}" y="2970"> 0%</text>
+  <text x="{$x0+10*$dx}" y="2970">10%</text>
+  <text x="{$x0+20*$dx}" y="2970">20%</text>
+  <text x="{$x0+30*$dx}" y="2970">30%</text>
+  <text x="{$x0+40*$dx}" y="2970">40%</text>
+  <text x="{$x0+50*$dx}" y="2970">50%</text>
+  <text x="{$x0+60*$dx}" y="2970">60%</text>
+  <text x="{$x0+70*$dx}" y="2970">70%</text>
+  <text x="{$x0+80*$dx}" y="2970">80%</text>
+  <text x="{$x0+90*$dx}" y="2970">90%</text>
+  <text x="{$x0+100*$dx}" y="2970">100%</text>
+ </g>
+
+ <!-- x-axis with ticks -->
+ <path style="stroke:#000000; stroke-width:6" d="M {($x0)+0},2842 L {($x0)+0},2881 z M {($x0)+10*$dx},2842 L {($x0)+10*$dx},2881 z M {($x0)+20*$dx},2842 L {$x0+20*$dx},2881 z M {$x0+30*$dx},2842 L {$x0+30*$dx},2881 z M {$x0+40*$dx},2842 L {$x0+40*$dx},2881 z M {$x0+50*$dx},2842 L {$x0+50*$dx},2881 z M {$x0+60*$dx},2842 L {$x0+60*$dx},2881 z M {$x0+70*$dx},2842 L {$x0+70*$dx},2881 z M {$x0+80*$dx},2842 L {$x0+80*$dx},2881 z M {$x0+90*$dx},2842 L {$x0+90*$dx},2881 z M {$x0+100*$dx},2842 L {$x0+100*$dx},2881 z  M {$x0+100*$dx},2842 L {$x0+0*$dx},2842 z"/>
+
+ <!-- y-axis without ticks -->
+ <path style="stroke:#000000; stroke-width:6" d="M {($x0)+0},2842 L {($x0)+0},300 z"/>
+
+       <xsl:call-template name="LOOP">
+          <xsl:with-param name="n">0</xsl:with-param>
+          <xsl:with-param name="last">10</xsl:with-param>  <!-- defines number of horizontal bars -->
+       </xsl:call-template>
+
+  </svg>
+</xsl:template>
+
+
+<!-- named templates to simplify ...  Use recursion to implement loop  -->
+
+<xsl:template name="ITEM">
+   <xsl:param name="i">0</xsl:param>
+   <xsl:param name="x">0</xsl:param>
+   <xsl:param name="y">0</xsl:param>
+   <xsl:param name="p">0</xsl:param>
+
+   <!-- tick on vertical axis -->
+   <path style="stroke:#000000; stroke-width:6" d="M {($x0)-30},{2842-$i*$dy} L {($x0)-1},{2842-$i*$dy} z"/>
+
+   <!-- label on vertical axis -->
+   <g style="font-family:Times New Roman;font-size:80; text-anchor:end;">
+       <text x='{($x0)-40}' y='{2842-$i*$dy}'>
+           <xsl:value-of select="$x"/>
+       </text>
+   </g>
+
+   <!-- rectangle representing frequency (0 to 100)-->
+   <g style="fill:#DBDBED;stroke-width:4; stroke:black">
+       <rect x="{($x0)+0}" y='{2842-$i*($dy)-176-24}' width="{format-number($p*$dx*100,'0')}" height="{($dy)-44}"/>
+   </g>
+</xsl:template>
+
+
+<xsl:template name="LOOP">
+    <xsl:param name="n">0</xsl:param>
+    <xsl:param name="last">0</xsl:param>
+
+    <xsl:variable name="cnt">
+        <xsl:choose>
+        <xsl:when test="$n &lt; $last">
+            <xsl:value-of select="count(&UNIT;[&SHORTMETRIC; >= $step_value*$n and &SHORTMETRIC; &lt; $step_value*($n+1) ])"/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="count(&UNIT;[&SHORTMETRIC; >= $step_value*$n])"/>
+        </xsl:otherwise>
+        </xsl:choose>
+     </xsl:variable>
+
+     <xsl:call-template name="ITEM">
+          <xsl:with-param name="i"><xsl:value-of select="$n"/></xsl:with-param>
+          <xsl:with-param name="x"><xsl:value-of select="$step_value*$n"/></xsl:with-param>
+          <xsl:with-param name="y"><xsl:value-of select="$cnt"/></xsl:with-param>
+          <xsl:with-param name="p"><xsl:value-of select="$cnt div count(&UNIT;)"/></xsl:with-param>
+     </xsl:call-template>
+
+     <xsl:if test="$n &lt; $last">
+        <xsl:call-template name="LOOP">
+            <xsl:with-param name="n">
+              <xsl:value-of select="$n+1"/>
+            </xsl:with-param>
+            <xsl:with-param name="last">
+              <xsl:value-of select="$last"/>
+            </xsl:with-param>
+        </xsl:call-template>
+     </xsl:if>  
+
+</xsl:template>
+
+</xsl:stylesheet> 

File build.res/codeqa.res/orig.xsls.before.modifications/checkstyle-noframes-severity-sorted.xsl

+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html" indent="yes"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+<xsl:key name="files" match="file" use="@name" />
+
+<!-- Checkstyle XML Style Sheet by Rolf Wojtech <rolf@wojtech.de>                   -->
+<!-- (based on checkstyle-noframe-sorted.xsl by Stephane Bailliez                   -->
+<!--  <sbailliez@apache.org> and sf-patch 1721291 by Leo Liang)                     -->
+<!-- Changes: 																								                      -->
+<!--  * Outputs seperate columns for error/warning/info                             -->
+<!--  * Sorts primarily by #error, secondarily by #warning, tertiary by #info       -->
+<!--  * Compatible with windows path names (converts '\' to '/' for html anchor)    -->
+<!--                                                                                -->
+<!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
+<!-- Usage (generates checkstyle_report.html):                                      -->
+<!--    <checkstyle failonviolation="false" config="${check.config}">               -->
+<!--      <fileset dir="${src.dir}" includes="**/*.java"/>                          -->
+<!--      <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/>         -->
+<!--    </checkstyle>                                                               -->
+<!--    <style basedir="${doc.dir}" destdir="${doc.dir}"                            -->
+<!--            includes="checkstyle_report.xml"                                    -->
+<!--            style="${doc.dir}/checkstyle-noframes-severity-sorted.xsl"/>        -->
+
+<xsl:template match="checkstyle">
+  <html>
+    <head>
+    <style type="text/css">
+    .bannercell {
+      border: 0px;
+      padding: 0px;
+    }
+    body {
+      margin-left: 10;
+      margin-right: 10;
+      font:normal 80% arial,helvetica,sanserif;
+      background-color:#FFFFFF;
+      color:#000000;
+    }
+    .a td {
+      background: #efefef;
+    }
+    .b td {
+      background: #fff;
+    }
+    th, td {
+      text-align: left;
+      vertical-align: top;
+    }
+    th {
+      font-weight:bold;
+      background: #ccc;
+      color: black;
+    }
+    table, th, td {
+      font-size:100%;
+      border: none
+    }
+    table.log tr td, tr th {
+
+    }
+    h2 {
+      font-weight:bold;
+      font-size:140%;
+      margin-bottom: 5;
+    }
+    h3 {
+      font-size:100%;
+      font-weight:bold;
+      background: #525D76;
+      color: white;
+      text-decoration: none;
+      padding: 5px;
+      margin-right: 2px;
+      margin-left: 2px;
+      margin-bottom: 0;
+    }
+    </style>
+    </head>
+    <body>
+      <a name="top"></a>
+      <!-- jakarta logo -->
+      <table border="0" cellpadding="0" cellspacing="0" width="100%">
+      <tr>
+        <td class="bannercell" rowspan="2">
+          <!--a href="http://jakarta.apache.org/">
+          <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
+          </a-->
+        </td>
+        <td class="text-align:right"><h2>CheckStyle Audit</h2></td>
+        </tr>
+        <tr>
+        <td class="text-align:right">Designed for use with <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
+        </tr>
+      </table>
+      <hr size="1"/>
+
+      <!-- Summary part -->
+      <xsl:apply-templates select="." mode="summary"/>
+      <hr size="1" width="100%" align="left"/>
+
+      <!-- Package List part -->
+      <xsl:apply-templates select="." mode="filelist"/>
+      <hr size="1" width="100%" align="left"/>
+
+      <!-- For each package create its part -->
+            <xsl:apply-templates select="file[@name and generate-id(.) = generate-id(key('files', @name))]" />
+
+      <hr size="1" width="100%" align="left"/>
+
+
+    </body>
+  </html>
+</xsl:template>
+
+
+
+  <xsl:template match="checkstyle" mode="filelist">
+    <h3>Files</h3>
+    <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+      <tr>
+        <th>Name</th>
+        <th>Errors</th>
+        <th>Warnings</th>
+        <th>Infos</th>
+      </tr>
+      <xsl:for-each select="file[@name and generate-id(.) = generate-id(key('files', @name))]">
+
+        <!-- Sort method 1: Primary by #error, secondary by #warning, tertiary by #info -->
+        <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error[@severity='error'])"/>
+        <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error[@severity='warning'])"/>
+        <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error[@severity='info'])"/>
+        
+        <!-- Sort method 1: Sum(#error+#info+#warning) (uncomment to use, comment method 1)  -->
+        <!--
+        <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error)"/>
+        -->
+
+        <xsl:variable name="errorCount" select="count(key('files', @name)/error[@severity='error'])"/>
+        <xsl:variable name="warningCount" select="count(key('files', @name)/error[@severity='warning'])"/>
+        <xsl:variable name="infoCount" select="count(key('files', @name)/error[@severity='info'])"/>
+
+        <tr>
+          <xsl:call-template name="alternated-row"/>
+          <td><a href="#f-{translate(@name,'\','/')}"><xsl:value-of select="@name"/></a></td>
+          <td><xsl:value-of select="$errorCount"/></td>
+          <td><xsl:value-of select="$warningCount"/></td>
+          <td><xsl:value-of select="$infoCount"/></td>
+        </tr>
+      </xsl:for-each>
+    </table>
+  </xsl:template>
+
+
+  <xsl:template match="file">
+    <a name="f-{translate(@name,'\','/')}"></a>
+    <h3>File <xsl:value-of select="@name"/></h3>
+
+    <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+      <tr>
+        <th>Severity</th>
+        <th>Error Description</th>
+        <th>Line</th>
+      </tr>
+        <xsl:for-each select="key('files', @name)/error">
+          <xsl:sort data-type="number" order="ascending" select="@line"/>
+      <tr>
+        <xsl:call-template name="alternated-row"/>
+        <td><xsl:value-of select="@severity"/></td>
+        <td><xsl:value-of select="@message"/></td>
+        <td><xsl:value-of select="@line"/></td>
+      </tr>
+      </xsl:for-each>
+    </table>
+    <a href="#top">Back to top</a>
+  </xsl:template>
+
+
+  <xsl:template match="checkstyle" mode="summary">
+    <h3>Summary</h3>
+        <xsl:variable name="fileCount" select="count(file[@name and generate-id(.) = generate-id(key('files', @name))])"/>
+    <xsl:variable name="errorCount" select="count(file/error[@severity='error'])"/>
+    <xsl:variable name="warningCount" select="count(file/error[@severity='warning'])"/>
+    <xsl:variable name="infoCount" select="count(file/error[@severity='info'])"/>
+    <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+    <tr>
+      <th>Files</th>
+      <th>Errors</th>
+      <th>Warnings</th>
+      <th>Infos</th>
+    </tr>
+    <tr>
+      <xsl:call-template name="alternated-row"/>
+      <td><xsl:value-of select="$fileCount"/></td>
+      <td><xsl:value-of select="$errorCount"/></td>
+      <td><xsl:value-of select="$warningCount"/></td>
+      <td><xsl:value-of select="$infoCount"/></td>
+    </tr>
+    </table>
+  </xsl:template>
+
+  <xsl:template name="alternated-row">
+    <xsl:attribute name="class">
+      <xsl:if test="position() mod 2 = 1">a</xsl:if>
+      <xsl:if test="position() mod 2 = 0">b</xsl:if>
+    </xsl:attribute>
+  </xsl:template>
+</xsl:stylesheet>
+
+

File build.res/codeqa.res/orig.xsls.before.modifications/checkstyle-noframes-sorted.xsl

+<xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html" indent="yes"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+<xsl:key name="files" match="file" use="@name" />
+
+<!-- Checkstyle XML Style Sheet by Stephane Bailliez <sbailliez@apache.org>         -->
+<!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
+<!-- Usage (generates checkstyle_report.html):                                      -->
+<!--    <checkstyle failonviolation="false" config="${check.config}">               -->
+<!--      <fileset dir="${src.dir}" includes="**/*.java"/>                          -->
+<!--      <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/>         -->
+<!--    </checkstyle>                                                               -->
+<!--    <style basedir="${doc.dir}" destdir="${doc.dir}"                            -->
+<!--            includes="checkstyle_report.xml"                                    -->
+<!--            style="${doc.dir}/checkstyle-noframes-sorted.xsl"/>                 -->
+
+<xsl:template match="checkstyle">
+	<html>
+		<head>
+		<style type="text/css">
+    .bannercell {
+      border: 0px;
+      padding: 0px;
+    }
+    body {
+      margin-left: 10;
+      margin-right: 10;
+      font:normal 80% arial,helvetica,sanserif;
+      background-color:#FFFFFF;
+      color:#000000;
+    }
+    .a td {
+      background: #efefef;
+    }
+    .b td {
+      background: #fff;
+    }
+    th, td {
+      text-align: left;
+      vertical-align: top;
+    }
+    th {
+      font-weight:bold;
+      background: #ccc;
+      color: black;
+    }
+    table, th, td {
+      font-size:100%;
+      border: none
+    }
+    table.log tr td, tr th {
+
+    }
+    h2 {
+      font-weight:bold;
+      font-size:140%;
+      margin-bottom: 5;
+    }
+    h3 {
+      font-size:100%;
+      font-weight:bold;
+      background: #525D76;