Marko Apfel - Afghanistan/Belgium/Germany

Management, Architecture, Programming, QA, Coach, GIS, EAI

  Home  |   Contact  |   Syndication    |   Login
  187 Posts | 2 Stories | 201 Comments | 4 Trackbacks

News



Twitter | LinkedIn | Xing

Archives

Post Categories

BizTalk

C#

Enterprise Library

SAP

SQL Server

Technologie

Steps to integrate simian

  1. add simian to VCS
    (in our case folder ./trunk/build/simian)
  2. add build step to your Hudson job
    (Execute Windows batch command)
  3. use following two commands
    .\trunk\build\Simian\bin\simian-2.2.24.exe
        -formatter=xml:.\trunk\bin\Simian.Result.xml
        -excludes=**/*.Test/**/*.cs
        -excludes=**/*.DbFrame/**/*.cs
        -excludes=**/*.DbLayout/**/*.cs
        -excludes=**/*.Designer.cs
        -excludes=**/XServer1_8.cs
        -threshold=10
        **/*.cs
    EXIT 0

Explanation

For better visibility and understanding i have splitted the first call (simian) over serveral lines. Needless to say that you must contract all parameters and arguments of the simian call in one line.

Parameter –formatter

specifies the output format as well as location and name of the result file

Parameter –excludes

allows exluding specific files

  • **/*.Test/**/*.cs
    all of our unit test projects names ends with .Test
    so this argument excludes all cs-files which are located beneath a folder (inclusive subdirectories!)  which name ends with .Test
  • **/*.DbFrame/**/*.cs and **/*.DbLayout/**/*.cs
    do not think about this! – these brownfield projects are so dirty, that code duplication is the smalles problem
  • **/*.Designer.cs
    because the Designer-files offten contains similar constructs they are a typicall candidate for duplicate code lines – this we should not respect
  • **/XServer1_8.cs
    this file contains several auto generated proxy classes for web services – also not interesting for us

Parameter -threshold

sets a threshold how many lines must be duplicated to be considered as a problem for the result file

last Parameter (**/*.cs)

scans all cs-file beneath the current working folder

EXIT command

Especially in brownfield projects you have the situation that programmers copied a lot of code lines. And if simian will find only one the variable %ErrorLevel% is 1 which indicates for Hudson, that something went wrong and you get a red build break.

So it could make sense to return 0 everytime and look sometimes to the Hudson dashboard.

posted on Wednesday, July 7, 2010 12:04 AM