8

Is it possible? Does it generate a report file?

Jader Dias
  • 88,211
  • 155
  • 421
  • 625
  • Duplicate of http://stackoverflow.com/questions/349855/how-to-automate-visual-studios-code-metrics-feature ? Also MS said in 2007 "The API of code metrics is not currently exposed. The scenario of recording code metrics regularly to evaluate the tren is something we are definitely considering for a future release." – Dennis G Jan 10 '11 at 12:12
  • @moontear Code Metrics is different from Code Analysis. The latter is more akin to FxCop and StyleCop. – Jader Dias Jan 10 '11 at 12:44
  • ok XMLforDoummies - thought they were the same ;-) – Dennis G Jan 10 '11 at 14:37
  • 1
    @moontear - Code Metrics is now supported from the commandline I did it today =) http://blogs.msdn.com/b/camerons/archive/2011/01/28/code-metrics-from-the-command-line.aspx – Maslow Apr 02 '11 at 01:52
  • @Maslow The blog post is from January, but I didn't know about the Power Tool. Nice!!! – Dennis G Apr 03 '11 at 19:58

1 Answers1

7

The FxCopCmd.exe command line tool can be used to run code analysis (which is the same thing as FxCop analysis) from the command line. In a VS 2010 installation that includes code analysis, you would typically find FxCopCmd.exe in the following folder: \Team Tools\Static Analysis Tools\FxCop.

FxCopCmd.exe can emit a report file. For details, see its command line options.

Nicole Calinoiu
  • 20,843
  • 2
  • 44
  • 49