Monday, June 26, 2006


Simian: A tool for Detecting Similar Code

Simian is a code similarity analyser that can be used to identify duplication in “…any human readable files…”. Simian runs natively in any .NET 1.1 or higher supported environment and on any Java 1.4 or higher virtual machine.

Howard van Rooijen shows how to integrate Simian into Visual Studio here Detecting duplicate code with Simian and also how to make it more usuable here MonkeyWrangler - Making Simian more usable in Visual Studio

To incorporate it into your NAnt automated build scripts, create a simian target:

<property name="Exec.Simian" value="C:\BuildTools\simian-2.2.8\bin\simian-2.2.8.exe"/>

<target name="runSimian" description="Runs Simian to find duplicate code">

<exec program="${Exec.Simian}">

<arg value="-recurse=${project.root}\*.cs"/>

<arg value="-formatter=xml:${build.outputfolder}\simian.xml"/>



The latest version of CruiseControl.Net already contains the necessary .XSL formatter to display the results in the CC.Net dashboard, just point it to the simian.xml output file.


Powered by Blogger