Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

fxcop

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?

like image 214
Paul Avatar asked Dec 08 '09 15:12

Paul


4 Answers

  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
like image 167
JaredPar Avatar answered Nov 11 '22 23:11

JaredPar


Yes absolutely. I used it for a year and a half. It spots all kinds of problems and gotchas and it's taught me a thing or two. Microsoft knows best in many cases.

Setting up is just a question of ticking a few boxes and modifying a few build scripts, well worth the effort. You will learn a lot from it if you research decisions it makes that you don't understand and remain open-minded.

like image 24
Joe Avatar answered Nov 11 '22 23:11

Joe


  1. Its Useful most of the time, not always! (you need to take it seriously only for some core issues, leaving out issues that are very particular to developing code in microsoft's style).

  2. Some of the guidance given by it is independent of style and is dependent on whether you are following good programming practices or not, so yes you can get some guidance from it.

  3. I don't think setup will take you much time, it should be couple of hours at max.

Thanks

like image 2
Mahesh Velaga Avatar answered Nov 11 '22 22:11

Mahesh Velaga


I find fxCop to be a good tool to enforce a coding standard. If you already have your own standard and you follow it consistently I don't see much reason to change, even more for so many lines of code. Setting up is pretty easy, running and fixing everything is something else.

like image 1
Otávio Décio Avatar answered Nov 11 '22 22:11

Otávio Décio