Skip to content

Commit 3b03abc

Browse files
committedJul 5, 2015
scan for duplicates
1 parent a753a11 commit 3b03abc

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed
 

‎appveyor.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ after_build:
3838
--codeVersion "$version"
3939
}
4040
41+
before_test:
42+
- ps: |
43+
if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True")
44+
{
45+
choco install resharper-clt -y
46+
dupFinder /output=dupReport.xml /show-text OpenRA.sln
47+
choco install xmlstarlet -y
48+
xml transform dupFinder.xslt dupReport.xml > dupReport.html
49+
choco install pandoc -y
50+
}
51+
4152
test_script:
4253
- nunit-console-x86.exe OpenRA.Test.dll
4354

@@ -63,4 +74,6 @@ artifacts:
6374
- path: OpenRA-$(APPVEYOR_REPO_TAG_NAME).exe
6475
name: Installer
6576
- path: coverity.zip
66-
name: Coverity Build
77+
name: Coverity Build
78+
- path: dupReport.html
79+
name: dupFinder Report

‎dupFinder.xslt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3+
<xsl:output method="html" indent="yes" />
4+
<xsl:template match="/">
5+
<html>
6+
<body>
7+
<h1>Statistics</h1>
8+
<p>Total codebase size: <xsl:value-of select="//CodebaseCost"/></p>
9+
<p>Code to analyze: <xsl:value-of select="//TotalDuplicatesCost"/></p>
10+
<p>Total size of duplicated fragments: <xsl:value-of select="//TotalFragmentsCost" /></p>
11+
<h1>Detected Duplicates</h1>
12+
<xsl:for-each select="//Duplicates/Duplicate">
13+
<h2>Duplicated Code. Size: <xsl:value-of select="@Cost"/></h2>
14+
<h3>Duplicated Fragments:</h3>
15+
<xsl:for-each select="Fragment">
16+
<xsl:variable name="i" select="position()"/>
17+
<p>Fragment <xsl:value-of select="$i"/> in file <xsl:value-of select="FileName"/></p>
18+
<pre><xsl:value-of select="Text"/></pre>
19+
</xsl:for-each>
20+
</xsl:for-each>
21+
</body>
22+
</html>
23+
</xsl:template>
24+
</xsl:stylesheet>

0 commit comments

Comments
 (0)
Please sign in to comment.