What static analysis tools are available for C#?

What tools are there available for static analysis against C# code? I know about FxCop and StyleCop. Are there others? I've run across NStatic before but it's been in development for what seems like forever - it's looking pretty slick from what little I've seen of it, so it would be nice if it would ever see the light of day.

Along these same lines (this is primarily my interest for static analysis), tools for testing code for multithreading issues (deadlocks, race conditions, etc.) also seem a bit scarce. Typemock Racer just popped up so I'll be looking at that. Anything beyond this?

Real-life opinions about tools you've used are appreciated.

Answers


Code violation detection Tools:

  • Fxcop, excellent tool by Microsoft. Check compliance with .net framework guidelines.(No longer available as a standalone download. It is now included in the Windows SDK and after installation can be found in Program Files\Microsoft SDKs\Windows\ [v7.1] \Bin\FXCop\FxCopSetup.exe)
  • Clocksharp, based on code source analysis (to C# 2.0)
  • Mono.Gendarme, similar to Fxcop but with an opensource licence (based on Mono.Cecil)
  • Smokey, similar to Fxcop and Gendarme, based on Mono.Cecil. No longer on development, the main developer works with Gendarme team now.
  • Coverity Preventâ„¢ for C#, commercial product
  • CAT.NET , visual studio addin that helps identification of security flaws
  • CodeIt.Right
  • Spec#
  • Pex

Quality Metric Tools:

  • NDepend, great visual tool. Useful for coupling and dependency studies.
  • Nitriq, free, can easily write your own metrics/constraints, nice visualizations.
  • RSM Squared, based on code source analysis
  • C# Metrics, using a full parse of C#
  • SourceMonitor, old tool EDIT a new version is out
  • Code Metrics, a Reflector add-in
  • Vil, old tool that doesn't support .NET 2.0

Checking Style Tools:

  • StyleCop, Microsoft tool ( run from inside of Visual Studio or integrated into an MSBuild project)
  • Agent Smith, code style validation plugin for ReSharper

Duplication Detection:

  • Simian, based on source code. Works with plenty languages.
  • CloneDR, detects parameterized clones only on language boundaries (also handles many languages other than C#)
  • Clone Detective a Visual Studio plugin. (It uses ConQAT internally)
  • Atomiq, based on source code, plenty of languages, cool "wheel" visualization

General Refactoring tools

  • ReSharper - Majorly cool C# code analysis and refactoring features

Need Your Help

jQuery onclick not getting triggered

jquery onclick

I have a list on my webpage. When someone clicks on a list item, some javascript should be executed. For example a alert. I get this working on a almost empty page, for example see this code:

How to stop background services after logout the application?

ios objective-c

I have created iPhone application with some Background fetching service process for data local notification purpose. Now the problem is I had logout my application then It's successfully gone from ...