O'Reilly logo

Professional Application Lifecycle Management with Visual Studio 2012 by Martin Woodward, Brian Keller, Mickey Gousset

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 19

Code Analysis, Code Metrics, and Code Clone Analysis

What's In This Chapter?

  • Enabling and running code analysis in Visual Studio 2012
  • Correcting code analysis rule violations
  • Understanding code metrics and how to use them
  • Using Code Clone Analysis to find similar code fragments in your code base

Wrox.com Code Downloads for this Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/remtitle.cgi?isbn=1118314081 on the Download Code tab. The files are in the Chapter 19 download folder and individually named as shown throughout this chapter.

This chapter describes the code analysis, code metric, and code clone analysis features included with the Visual Studio 2012 Premium and Ultimate editions. These tools can quickly and easily inspect your code to find common mistakes, make suggestions for improvements, and even indicate violations of standards.

The discussion begins by examining the origins of the Static Code Analysis tool. You find out about Microsoft's .NET “Design Guidelines for Class Library Developers” and how it is related to the tools. You also take a brief look at what is new with these tools in Visual Studio 2012.

Then you do a bit of exploration into the code analysis itself and how to take advantage of its full integration with Visual Studio 2012. This includes enabling static code analysis review for your projects, selecting rules to apply, and working with the results of the analysis.

However, using the IDE is not always an option, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required