cruisecontrol.netsimian

Simian not detecting duplicate code in CruiseControl.Net integration


My Simian Similarity Analyzer task looks like this:

<exec>
<executable>C:\\Program Files (x86)\simian\bin\simian-2.3.33.exe</executable>
<buildArgs>-includes=*.cs -formatter=xml:build\log\simian.xml-failOnDuplication</buildArgs>
</exec>

The build log looks like this:

<simian version="2.3.33">
    <check failOnDuplication="true" ignoreCharacterCase="true" ignoreCurlyBraces="true" ignoreIdentifierCase="true" ignoreModifiers="true" ignoreStringCase="true" threshold="6">
        <summary duplicateFileCount="0" duplicateLineCount="0" duplicateBlockCount="0" totalFileCount="0" totalRawLineCount="0" totalSignificantLineCount="0" processingTime="94"/>
    </check>
</simian>

I know the solution has duplicate code, so I guess I'm missing something, any pointers?


Solution

  • totalFileCount="0" points to Simian not finding any files. Try running it like this (I'm guessing CruiseControl.Net is doing some needless escaping on your command line):

    <exec>
      <executable>C:\\Program Files (x86)\simian\bin\simian-2.3.33.exe</executable>
      <buildArgs>-includes=**/*.cs -formatter=xml:build\log\simian.xml -failOnDuplication</buildArgs>
    </exec>
    

    Another important difference in this syntax is -includes=**/*.cs, which instructs Simian to include subdirectories in file search.