I am using sonarqube developer's edition and i cannot see any options to deactivate a active rule in any quality profile as there was in basic version.
Can anyone please give me an idea as to to deactivate any active rule while using sonarqube commercial?
Thanks
You can't edit built in profiles. Probably what you want to do is
create a new profile, say P1
set it as the default
copy into it the rules from the profile you have been using
edit (add/delete/update) the rules in P1 to meet your needs
Alternately, 'P1' could inherit from Sonar way, but then you wouldn't be able to remove rules that were added by inheritance, only edit (presumably downgrade) their severities. You would still be able to add new rules and then subsequently remove those rules you had added directly.
Related
I need to Disable the builtin rules which is present in SonarQube
It is throwing many bugs because of the below rule
I tried removing it , since it is a builtin rule i could not find any option for removing the rule
<strong> and <em> tags should be used -> it is considered as a bug in sonarqube
Please provide the solution for removing the above rule from the rule list of the sonarqube of my project
You can not deactivate rule in a built-in profile. You will need to create your own quality profile (click on Quality Profile menu). Once you have your own quality profile you can activate/deactivate/customize rules at will.
Don't forget to associate the profile with your project or set it as a default afterwards.
I'm a big fan of SonarQube as a developer. This time though I need to do admin work since I need to configure it from a fresh install. I see this rule in SonarQube "Methods should not have too many lines" but I don't see that it belongs to any of the default profiles ("FindBugs+FB-Contrib", "Sonar Way"). I think that's the reason I don't see any rule violations of this type from any of the projects. I thought this should be part of a common default profile since this is a pretty common violation. How can I add this rule to the profile?
There are other rules that I need to add which I expected also to be in the default/available profiles already.
You can't edit built-in profiles. Instead, you'll have to create a new profile, and then you'll be able to edit the rules to your heart's content. I suggest you initialize your new profile either by copying the rules from the built-in profile of your choice, or by inheriting from that profile. Note that choosing the latter means your profile can (and probably will) be updated by upgrading your analyzers; each new version of SonarJava, for instance, implements new rules and many of them are added to the Sonar way profile.
I have the default profile for JAVA in SonarQUBE as Sonar way.
Now, when I try to deactivate any rules in it, there is no way I can do it.
How do I specifically disable rules for this profile?
You do not. Starting with SonarQube 6.5 default profiles are not editable. Instead, make a new profile and copy the Sonar way rules into it. Then you'll be able to edit your copy.
If after each upgrade you want to make sure you haven't missed any exiting new rules, just compare your copy with Sonar way and edit your profile to handle the differences.
I've read the docs about profile inhertiance [1]. They say that "A rule inherited from a parent cannot be deactivated". Is this on purpose and will it be supported in the future?
When I upgrade some plugin (i.e. the JavaScript analysis plugin) there are new rules and I have to restore the built-in profile "Sonar Way" in order to get the new rules. However when I do this I lose all the previous configurations (deactivated rules) and I have to remember what I've done in the past and repeat that again.
It sounds like you're using the built-in profile as your default profile. If you're happy with the built-in profile as-is, then that's a great way to go. But it sounds like you're not. So instead, I'd suggest you make a copy of Sonar Way, I'll call it 'Copy', and set it as your default profile. Then after each upgrade, you can reset Sonar Way, use the comparison service to see the differences between Copy and Sonar Way and then choose which new changes to apply in Copy.
I would like to use the default rule set provided by sonarqube (5.1.2) which is collected in the default profile "sonar way". Now I need to add/remove some rules. What is the bets practice here? So far I have created a copy of the default profile and applied my changes there. Then after installing a new plugin I noticed that the default profile has been extend by some rules (obviously the useful ones) of that new plugin. So I need to add them manually to my custom profile. I reckon the same happens with updates of the java plugin.
My questions:
Should I work with a copy of the original profile to not pollute it and retain the opportunity to restore it to the factory defaults? (conclusion: manual work every time an update or new plugin comes in)
Should work with the original profile? (will it then still be updated without conflicts on new plugins/updates?)
Is there a way to work with a profile that is linked to the original profile? (like an overlay filesystem over a read only filesystem => OverlayFS)
You might be interested in profile inheritance: http://docs.sonarqube.org/display/SONAR/Non-rule+Profile+Edits+and+Information#Non-ruleProfileEditsandInformation-ProfileInheritance