Issue with Bubble Graph in Measures tab Project Overview (SonarQube Community Build v24.12.0.100206)

  1. What are you trying to accomplish?

    • I am working with the SonarQube Community Build v24.12.0.100206 and utilizing the custom plugin example provided by SonarQube (GitHub - sonar-custom-plugin-example, 10.x branch).
    • I am attempting to extend an existing language, specifically Java, by creating custom quality profiles with specific rules.
    • The goal is to ensure that multiple quality profiles can coexist without affecting the project measure tab.
  2. What’s your specific coding challenge in developing your plugin?

  • When I create another quality profile for the same language (Java) and set it for a project, the measure tab stops displaying the bubble graph in the project overview.
  • I need guidance on whether this is an expected behavior or if there are specific steps required to maintain the graph display when switching quality profiles.
  1. If relevant, please share the code that’s giving you problems:
  • Since the issue relates to the interaction between quality profiles and the measure tab, it is unclear whether the problem lies in the plugin code itself or in the SonarQube UI behavior.
  • If required, I can share relevant sections of the plugin code that define the rules and profile settings

Hi,

Welcome to the community!

You don’t need a plugin to create Quality Profiles. That can be done through the UI. You only need a plugin if you want to add new rules.

This is basic functionality. You can have as many profiles as you like.

Let’s look at what the bubble graph shows.

Bubble size is LoC and Coverage is the y-axis. I assume those things are approximately unvarying, regardless of which profile you’re applying.

Technical Debt is the x-axis. Technical Debt, as such, is only calculated for Maintainability / Code Smell issues.

Color is the “Worse of Reliability Rating and Security Rating”.

My hypothesis: your profiles contain only one type of Rule and thus one type of issue, so for each file that should appear as a bubble on the graph, a crucial value is missing because you aren’t applying any rules related to it.

Does that make sense? Ring true?

 
HTH,
Ann

Hi Ann,

Thanks for the detailed explanation and your helpful insights!

To clarify, I’ve developed a custom plugin that includes rules for multiple languages, and I’ve created separate quality profiles for each language using those rules. Everything works as expected up to SonarQube version 10.7 — the profiles apply correctly, and the Measures tab (including the bubble graph) displays data properly.

However, starting with the Community Build after version 10.7, the bubble graph in the project overview disappears when I apply a quality profile that uses rules from my plugin. The same plugin works fine from SonarQube 8.9 through 10.7, so this behavior seems to be introduced in versions beyond that.

Could this be related to changes in how SonarQube handles rule types, issue indexing, or metrics calculation in the latest versions? I would really appreciate any guidance on what might be causing this or how I can debug it further.

Thanks again for your support!

Hi,

I suppose this means it works as expected in 10.7 as well? In 10.8 we added the toggle between MQR (multi-quality rule) mode and Standard mode.

Do you see problems with the graph when you’re using a built-in profile?

And does your plugin add any new rules? Or just create profiles?

 
Thx,
Ann

Hi Ann,

Yes, it works as expected in 10.7 as well.

Here’s the typical process we follow:

  1. We create a project and run the initial scan using the Sonar command. This gives us the results and the measures graph displays correctly.
  2. Then, we select a specific quality profile and re-run the scan. The results update according to the selected rules, and the bubble graph continues to work properly—all the way up to version 10.7.

To answer your other questions:

  • We haven’t seen any issues with the graph when using built-in profiles.

  • Yes our plugin add new rules.

Hi,

Can you tell me about your custom rules?

In 10.2 we switched to what we now call MQR mode. In 10.8 we added the ability to toggle back to Standard (pre-10.2) mode.

Which mode are you running 10.8+ in? And did up update your rule specifications to have values for both MQR and Standard mode?

 
Ann

Hi,

We are running Standard mode in 10.8 community versions.

<rule>
    <key>rule_2</key>
    <name>DefaultQuery</name>
    <severity>INFO</severity>
    <tag>custum-info</tag>
    <type>VULNERABILITY</type>
    <remediationFunction>LINEAR</remediationFunction>
    <remediationFunctionGapMultiplier>1min</remediationFunctionGapMultiplier>
</rule>

This is my custom rule looks like.

(GitHub - SonarSource/sonar-custom-plugin-example: Shows how to write a SonarQube Server plugin) I am using branch 10.x and in this code when I am creating Java profile with rules given same issue observed.

Hi,

Thanks for the rule metadata.

And you’re currently, actively running 10.8? Because it’s EOL in all editions. I thought you were just noting where the problem started.

Only the latest version of SonarQube Community Build is considered active, so you’ll need to upgrade and see if the situation is still replicable before we can help you.

Your upgrade path is:

20.8 → 24.12 → 25.5

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

 
Thx,
Ann

Hi,

We tried it on latest version Release 25.5.0.107428 same issue measures disappeared after selecting custom quality profile.

What info from my side is required ?

1 Like

Hi,

Is there anything interesting in your browser console?

 
Thx,
Ann

Hi,

All API’s working propely no major difference between previous and current version.

Can someone from you side try GitHub - SonarSource/sonar-custom-plugin-example: Shows how to write a SonarQube Server plugin 10.x branch which will have custom Java quality profile just to be sure its a bug in newer versions.

Hi,

I’ve flagged this for the team.

 
Ann

Thank you

Waiting for your reply.

This issue is a bit urgent for me as it is currently blocking my work. Would you please be able to take a look at the provided information and let me know if you require any further details?

Hi,

I’ve flagged this for the experts. Hopefully they’ll be along soon, but they operate on their own timeline.

 
:sweat_smile:
Ann

Hi @amol_mane,

I am trying to reproduce your issue, in the meantime could you share the response of api/measures/component_tree endpoint before and after setting your custom quality profile? I would like to see if there is a difference in responses. You may hide your component keys/names if you want or send it to me directly.

Also, seeing how you define the rules would be very helpful.

NotWorkingMeasure.txt (58.9 KB)
WorkingMeasure.txt (64.9 KB)

Hi

Please find attached API response for working and not working measure.

I have created quality profile and rules as below

NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile("Java Rules", "java");
profile.setDefault(true);
profile.activateRule("java", "S2204");
profile.activateRule("java", "S6829");
profile.done();

One more thing I have observed when I use this two rules I am able to see measures graph
profile.activateRule(“java”, “S2093”);
profile.activateRule(“java”, “S1075”);

and when I use this two
profile.activateRule(“java”, “S2204”);
profile.activateRule(“java”, “S6829”);
Measure graph disappears.

This is happening in sample plugin given by sonar community

branch 10.x

Hi @amol_mane, thanks for the information provided!

I have investigated your findings and can confirm the problem. It appears there’s a change in how the code_smells measure is handled when no code smells are found during analysis.

Specifically:

  • In SonarQube 10.7, even when no code smells were detected, the code_smells measure with a value of 0 was still present in the history and included in the API response.
  • In versions after 10.7, if no code smells are found, the code_smells measure is absent from the API response.

This absence of the code_smells measure when its value is zero is causing the bubble chart in the Project Overview to not be displayed.

So, this doesn’t seems to be related to plugin, but a problem on SonarQube side. I’ve created a ticket to fix it on our side.

By the way, I suspect that with rules ‘S2093’ and ‘S1075’ enabled, your project might have found code smells, while with ‘S2204’ and ‘S6829’ no code smells were detected. Let me know if that’s not the case.

Unfortunately, I don’t have a workaround for you at the moment, but to wait for the fix to be implemented.

1 Like

Thank you, @Stan, for confirming. We will wait for the issue to be resolved. Additionally, I have one more result JSON that I will attach. Please review and let me know what might be missing.