O'Reilly logo

Sonar Code Quality Testing Essentials by Charalampos Arapidis

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 8. Working with Duplicated Code

In this chapter, we will review how Sonar tracks duplication in our software application. Sonar features four essential metrics to measure duplication across projects and presents metrics in a widget format inside the project dashboard. Knowing the metrics and having created an alert when duplication metrics , we will take a look at the widget and use it to effectively drill down to our source code, locating duplicated lines and blocks. To get a top-layer view, we will use the Radiator component, as it is ideal to highlight duplication spread for large projects.

In this chapter, we will cover:

  • Code duplication
  • Sonar code duplication metrics
  • Locating duplicated code with Sonar
  • The Useless Code Tracker plugin

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