Book Image

Visual Studio 2015 Cookbook - Second Edition

By : Jeff Martin
Book Image

Visual Studio 2015 Cookbook - Second Edition

By: Jeff Martin

Overview of this book

Visual Studio 2015 is the premier tool for developers targeting the Microsoft platform. Learning how to effectively use this technology can enhance your productivity while simplifying your most common tasks, allowing you more time to focus on your project. Visual Studio 2015 is packed with improvements that increase productivity, and this book walks you through each one in succession to help you smooth your workflow and get more accomplished. From customization and the interface to code snippets and debugging, the Visual Studio upgrade expands your options — and this book is your fast-track guide to getting on board quickly. Visual Studio 2015 Cookbook will introduce you to all the new areas of Visual Studio and how they can quickly be put to use to improve your everyday development tasks. With this book, you will learn not only what VS2015 offers, but what it takes to put it to work for your projects.
Table of Contents (17 chapters)
Visual Studio 2015 Cookbook Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Detecting duplicate code


Copy and paste development is generally regarded as a bad practice, because bug fixes or enhancements in one area of code have to be repeated in all the other copies of the same code. Not only is this time consuming and tedious, but in large code bases, it's very easy to miss a change, leading to bugs and lower overall quality.

Frequently, code duplication can be unavoidable, especially on larger projects with multiple contributors. Not to mention that using an unfamiliar code base can make it easy to unintentionally write duplicate code. With Visual Studio, Microsoft has provided a way to detect these duplicates so that you can take remedial action to clean it up. Let's see how this is done.

Getting ready

You will need Visual Studio Enterprise 2015 for this recipe. Start it up, and you're ready to go.

Tip

Visual Studio 2013 Premium and Ultimate also support this feature.

How to do it…

  1. Create a new Class Library project under Visual C#, and name the project OriginalLibrary...