Full documentation for SonarQube has moved to a new location: http://docs.sonarqube.org/display/SONAR

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 37 Next »

The C# Ecosystem is a Set of Plugins

The C# Ecosystem offers the following plugins:

  • Mandatory plugins:
    • .NET Core: the core plugin that defines API used by every other plugin in the ecosystem.
    • C# Squid: the plugin that parses C# code source, computes metrics and detects copy-paste.
       
  • Optional plugins adding features from external tools:
    • .NET FxCop: launches FxCop analyses to detect violations relating to potential bugs, tight coupling, globalization, etc.
    • .NET Gendarme: launches Gendarme analyses to detect violations relating to coding bad practices, smell detection, performance, etc
    • .NET Gallio: launches Gallio to run tests and gets execution report as well as coverage report (using PartCover or OpenCover or NCover or ...).
    • .NET NDeps: launches a dependency parser tool, built on Mono Cecil, to get dependency data between assemblies and classes. 
    • C# StyleCop: launches StyleCop analyses to detect violations mainly relating to coding style (formatting, comments, ...).

Requirements

The C# Ecosystem has the following requirements on top of the Sonar ones:

  • Your C# code base must be developed with Visual Studio, and thus must contain a ".sln" file (.NET Solution).
  • If you want test metrics, unit tests must be isolated from the main code base in dedicated Visual Studio Projects. Also the test framework must be compatible with Gallio.
  • Supported versions are:

    C# language

    Up to 4.0

    .NET framework

    2.0, 3.5 and 4.0

    Silverlight

    3 and 4

    Visual Studio

    Tested with VS 2008 and VS 2010 ".sln" files.
    Older versions may also be supported (feel free to give feedback)

Installing the C# Ecosystem Plugins

  1. Download the zip archive that contains the latest version of the C# Ecosystem plugins and unzip it
  2. Copy the plugins you need into the SONAR_HOME/extensions/plugins directory
  3. Restart the Sonar server

Installing the External Tools

Depending on which plugins you chose to install, you may need to install the corresponding external tools. If you can, we advise you to install the same versions as the one we use for testing (i.e. the one in bold in the below table).

Where to Install the External Tools

Icon

This may sound obvious if you are already familiar with Sonar: Sonar analysis is not necessarily performed on the same machine as the one running your Sonar server. This means that you can run Sonar on a Linux box and run analyses on Windows boxes. The external tools have to be installed on the Windows boxes where analyses are performed.

Tool

Install required if plugin selected?

Web site / download / install guide

Supported versions (Tested one in bold)

FxCop

YES

http://www.infoq.com/news/2010/06/FXCop-10

1.36+ (10.0)

StyleCop

NO, StyleCop 4.7 binaries are embedded in the plugin.

http://stylecop.codeplex.com

4.6+ (4.7)

Gendarme

NO, Gendarme 2.10 binaries are embedded in the plugin.

http://www.mono-project.com/Gendarme

2.10+ (2.10)

Gallio

YES

http://www.gallio.org

3.1 Update 2 + (3.2.3)

PartCover

YES if you want to use PartCover as the coverage engine.
Since PartCover is no longer maintained, OpenCover is preferred.

https://github.com/sawilde/partcover.net4
(click on the "Downloads" button)

2.2, 2.3 and 4.0 (4.0)

NCover

YES if you want to use NCover as the coverage engine

http://www.ncover.com

3.0 (3.0)

OpenCover

YES if you want to use OpenCover as the coverage engine.
OpenCover is preferred to PartCover.
You need .NET 4 installed on your build machine in order to use OpenCover.

https://github.com/sawilde/opencover

1.0.X, 2.0.X (2.0.8)

JetBrains dotCoverYES if you want to use dotCover as the coverage engine.http://www.jetbrains.com/dotcover/1.X, 2.X (1.2 & 2.0)
NDepsNO, binaries are embedded in the plugin.https://github.com/grozeille/DependencyParser 

Some notes:

  • These external tools need the .Net framework to be installed. FxCop10 needs .Net 4 but the other ones runs fine with .Net 3.5.
  • StyleCop plugin relies on MsBuild to run the analysis.
  • Former versions of the StyleCop plugin (1.3 and before) were embedding StyleCop 4.4, whereas new versions (1.4+) are embedding StyleCop 4.7.34.0.
  • No labels