Unable to set Quality Profiles with 0 rules as default in Developer edition of SonarQube ( was able to do this on the Community Edition )

  • I am using SonarQube, Developer Edition Version 9.3 (on the 14-day trial)

  • I want to use SonarQube to raise issues only for one rule( for which I have a custom plugin installed and working). On the Community Edition, I was able to create empty quality profiles and set them as default to avoid raising issues not relevant to me. However, in the trial version of the Developer edition, I’m unable to set quality profiles with no rules activated as default.

  • My plugin is installed under the Java Quality profile as there is no need to repeat steps for other quality profiles. Sonar scans all projects with all language scanners, so this java scanner will be
    applied to all projects regarding of their source code language (which is usually mixed anyway).

  • So I would like help in creating empty quality profiles with no activated rules and setting them to be the default quality profiles on my SonarQube dashboard .

Hey there.

Setting a Quality Profile with 0 rules as the default is no longer possible since SonarQube v9.1 (SONAR-13150).

Hey,

I think I found a workaround for this. ( on the Developer edition v9.4 SonarQube )

  • Extend the current default Quality profile ( usually Sonar way ), let’s call it New profile
  • Set New profile as the Default Quality profile
  • Go ahead and change the inheritance of New profile to none (there’s this option called change parent)
  • A warning message is displayed, But it still works the way it’s supposed to!

The current profile is the default profile, but it has no active rules. Please activate at least 1 rule for this profile.

I understand that a QP with 0 rules makes everything super green, and makes it seem like the code quality is great even when it’s not,

But I think this option could be available for the user to choose from,
For a user like me, I need SonarQube to scan through my code only looking for certain keywords.
It’s a lot of unwanted hassle for me to go through several other issues, that I don’t need to deal with.
The option of being able to create a 0 rule QP is in fact very useful and time-saving to me while running the scans.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.