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 9. Analyzing Complexity and Design

In this chapter, we will discuss how Sonar reports on complexity and the measures it supports. Firstly, we will clarify how complexity in Java programs is calculated and then look into the concepts of coupling, cohesion, and dependencies.

Finally, we will review how Sonar reports on those measures and especially detail the design matrix, which is an essential component to manage dependencies in complex software pieces.

In this chapter we will cover:

  • Measuring software complexity
  • Cohesion and coupling
  • Sonar code complexity metrics
  • The Response for Class metric
  • Lack of cohesion and the LCOM4 metric
  • Locating and eliminating dependencies

Measuring software complexity

Software and its complexity could be described as ...

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