scan for duplicates
This commit is contained in:
15
appveyor.yml
15
appveyor.yml
@@ -38,6 +38,17 @@ after_build:
|
||||
--codeVersion "$version"
|
||||
}
|
||||
|
||||
before_test:
|
||||
- ps: |
|
||||
if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True")
|
||||
{
|
||||
choco install resharper-clt -y
|
||||
dupFinder /output=dupReport.xml /show-text OpenRA.sln
|
||||
choco install xmlstarlet -y
|
||||
xml transform dupFinder.xslt dupReport.xml > dupReport.html
|
||||
choco install pandoc -y
|
||||
}
|
||||
|
||||
test_script:
|
||||
- nunit-console-x86.exe OpenRA.Test.dll
|
||||
|
||||
@@ -63,4 +74,6 @@ artifacts:
|
||||
- path: OpenRA-$(APPVEYOR_REPO_TAG_NAME).exe
|
||||
name: Installer
|
||||
- path: coverity.zip
|
||||
name: Coverity Build
|
||||
name: Coverity Build
|
||||
- path: dupReport.html
|
||||
name: dupFinder Report
|
||||
|
||||
24
dupFinder.xslt
Normal file
24
dupFinder.xslt
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="html" indent="yes" />
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<body>
|
||||
<h1>Statistics</h1>
|
||||
<p>Total codebase size: <xsl:value-of select="//CodebaseCost"/></p>
|
||||
<p>Code to analyze: <xsl:value-of select="//TotalDuplicatesCost"/></p>
|
||||
<p>Total size of duplicated fragments: <xsl:value-of select="//TotalFragmentsCost" /></p>
|
||||
<h1>Detected Duplicates</h1>
|
||||
<xsl:for-each select="//Duplicates/Duplicate">
|
||||
<h2>Duplicated Code. Size: <xsl:value-of select="@Cost"/></h2>
|
||||
<h3>Duplicated Fragments:</h3>
|
||||
<xsl:for-each select="Fragment">
|
||||
<xsl:variable name="i" select="position()"/>
|
||||
<p>Fragment <xsl:value-of select="$i"/> in file <xsl:value-of select="FileName"/></p>
|
||||
<pre><xsl:value-of select="Text"/></pre>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
Reference in New Issue
Block a user