Search code examples
c#fxcop

Is fxcop a valuable/effective tool for improving code quality?


I have a large high quality c# framework codebase that I nevertheless want to try to improve.

  1. Is fxcop an effective tool for improving .NET frameworks? I know Microsoft uses the tool internally, but how do external users find it? Worthwhile?

  2. I already have a zillion lines of code and a well established style, can it be adapted to our style and still provide good guidance?

  3. Roughly, how long will it take to set up? Hours, days, weeks? Will I learn something useful sooner that later?


Solution

    1. Yes FxCop is a very effective tool for improving .Net code bases. In addition to finding many different types of bugs (globalization, pinvoke, security, performance) it will also warn you of various style issues that violate conventions. And point out the occasional spelling error.
    2. FxCop is highly customizable. You could for instance turn off all style recomendations and enable only bug checking. That would give you immediate benefits without having to change your style at all.
    3. Really depends on how much of FxCop you enable and how big your code base is. I find that in my personal projects it rarely takes more than an hour to set up. But for a large project I would schedule a day or 2