Sonarqube analysis cannot detect inappropriate intimacy coupling in Java code

Hi,

I’m using SonarQube Enterprise Edition Version 9.2.4.

I’m preparing instruction material for developers and created a Java project with example for “inappropriate intimacy”

sonar scan returns zero issues with the code.

Are there no rules for catching this sort of code smells?

The code I’m scanning is here:

My code based on this github repo:

and this video tutorial:

Thanks,
Eyal

Hi Eyal,

Welcome to the community!

“Inappropriate intimacy” is a new pattern for me (and I Googled it very gingerly :joy:).

To answer your question, we don’t currently have a rule for this. The classes in your example are each calling public APIs and building a heuristic for when it crosses the line into too much would be tricky to get right, IMO. But I don’t implement rules. :slight_smile:

 
Ann

putting the glasses on :nerd_face:

What would be valuable metrics to check for? I, too, was eager to search the term. And found quite a large amount of interesting results.

But then i refined my search to look for metrics that evaluate this kind of intimacy … and there it got rather shallow. Actually i did not find any stated metrics, but i did not search very intensely.

So my first gut feeling persists: “how should i - at all - measure this rather nebulously claimed intimacy thing” :interrobang: :man_shrugging:

1 Like