Question about Cyclic Dependency, Fan-In, and Fan-Out Metrics in SonarQube

Hi SonarQube Community,

I’m looking into ways to improve maintainability and analyze the architecture of my projects using SonarQube Enterprise Edition. I’m particularly interested in whether SonarQube can help with the following:

  • Cyclic Dependencies: Detecting dependency cycles between modules or packages.
  • Fan-In: Measuring how many other modules or functions depend on a specific module or function.
  • Fan-Out: Measuring how many modules or functions a specific module or function depends on.

Just to explain why these are important to me: a high Fan-In can point to a heavily reused module that could become a bottleneck if not well-maintained, while a high Fan-Out can indicate a module with too many dependencies, potentially leading to tight coupling.

Does SonarQube offer built-in support for calculating these metrics (through rules or other means)? If not, are there any plugins or integrations that could help? Any pointers on where to find this information within SonarQube (like the Measures tab or Dependency Graph) would be really helpful.

Thanks in advance for any assistance!

1 Like

Hi,

Welcome to the community!

IIRC, many, many moons ago we had those metrics. And killed them because too few people understood and used the data.

And we recently introduced some Java architecture rules, announced here and here.

The Structure 101 announcement may also be of interest in this context. :wink:

 
HTH,
Ann

1 Like